home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Odesa_Very2120947182008.psc / File Search / Button.ctl
Text File  |  2007-10-29  |  159KB  |  3,237 lines

  1. VERSION 5.00
  2. Begin VB.UserControl Button 
  3.    ClientHeight    =   3600
  4.    ClientLeft      =   0
  5.    ClientTop       =   0
  6.    ClientWidth     =   4800
  7.    ScaleHeight     =   3600
  8.    ScaleWidth      =   4800
  9. End
  10. Attribute VB_Name = "Button"
  11. Attribute VB_GlobalNameSpace = False
  12. Attribute VB_Creatable = True
  13. Attribute VB_PredeclaredId = False
  14. Attribute VB_Exposed = False
  15. Option Explicit
  16. '''''''''''''''''''''''''''''''''''''''''''''''''''''
  17. ' ************************************************* '
  18. ' *                                               * '
  19. ' *  Control Name:   ShapeButton                  * '
  20. ' *                                               * '
  21. ' *  Created:        10/September/2007            * '
  22. ' *                                               * '
  23. ' *  Created by:       Ahmed Alotiabe             * '
  24. ' *                                               * '
  25. ' *  You Have A Royalty Free Right To Use         * '
  26. ' *  Modify And Reproduce And Distribute.         * '
  27. ' *                                               * '
  28. ' *  But I Assume No Warranty, Obligations        * '
  29. ' *  Or Liability For The Use Of This Code.       * '
  30. ' *                                               * '
  31. ' *   For Any Damage This Control                 * '
  32. ' *           Can Cause To Your Products.         * '
  33. ' ************************************************* '
  34. '''''''''''''''''''''''''''''''''''''''''''''''''''''
  35.  
  36. '>> Needed For The API Call >> GradientFill >> Backgraound
  37. Private Type GRADIENT_RECT
  38.     UpperLeft            As Long
  39.     LowerRight           As Long
  40. End Type
  41.  
  42. Private Type TRIVERTEX
  43.     X                    As Long
  44.     Y                    As Long
  45.     Red                  As Integer
  46.     Green                As Integer
  47.     Blue                 As Integer
  48.     Alpha                As Integer
  49. End Type
  50. '............................................................
  51. '>>Needed For The API Call >> CreatePolygonRgn >> Polygon
  52. '>>Postion For Picture And Caption ...etc.
  53. Private Type POINTAPI
  54.     X                    As Long
  55.     Y                    As Long
  56. End Type
  57. '............................................................
  58. '>> Constant Types Used With CreatePolygonRgn
  59. Private Const WINDING    As Long = 2
  60.  
  61. '............................................................
  62. '>> Constant Types Used With GradientFill
  63. Private Const GRADIENT_FILL_RECT_H As Long = &H0
  64. Private Const GRADIENT_FILL_RECT_V As Long = &H1
  65.  
  66. '............................................................
  67. '>> Constant Types For LinsStyle
  68. Private Const BDR_VISUAL As Long = vb3DDKShadow
  69. Private Const BDR_VISUAL1 As Long = vbButtonShadow
  70. Private Const BDR_VISUAL2 As Long = vb3DHighlight
  71.  
  72. '............................................................
  73. '>> Constant Types For LinsStyle
  74. Private Const BDR_FLAT1  As Long = vb3DDKShadow
  75. Private Const BDR_FLAT2  As Long = vb3DHighlight
  76.  
  77. '............................................................
  78. '>> Constant Types For LinsStyle
  79. Private Const BDR_JAVA1  As Long = vbButtonShadow
  80. Private Const BDR_JAVA2  As Long = vb3DHighlight
  81.  
  82. '............................................................
  83. '>> Constant Values For White Border >> IF Mouse Down Button
  84. Private Const BDR_PRESSED As Long = vb3DHighlight
  85.  
  86. '............................................................
  87. '>> Constant Values For Gold Border >> IF Mouse Over Button
  88. Private Const BDR_GOLDXP_DARK As Long = &H109ADC
  89. Private Const BDR_GOLDXP_NORMAL1 As Long = &H31B2F0
  90. Private Const BDR_GOLDXP_NORMAL2 As Long = &H90D6F7
  91. Private Const BDR_GOLDXP_LIGHT1 As Long = &HCEF3FF
  92. Private Const BDR_GOLDXP_LIGHT2 As Long = &H8CDBFF
  93.  
  94. '............................................................
  95. '>> Constant Types For LinsStyle
  96. Private Const BDR_VISTA1 As Long = vbWhite
  97. Private Const BDR_VISTA2 As Long = &HCFB073
  98.  
  99. '............................................................
  100. '>> Constant Types For FocusRect
  101. '>> If Display Properties Colors IS Hight Color(16Bit)Use
  102. 'Private Const BDR_FOCUSRECT As Long = &HC0C0C0    '>> Color Gray
  103.  
  104. '>> If Display Properties Colors IS TrueColor(32Bit)Use
  105. Private Const BDR_FOCUSRECT As Long = &HD1D1D1             '>> Color LightGray
  106. '>> Constant Types For FocusRect Java
  107. Private Const BDR_FOCUSRECT_JAVA As Long = &HCC9999        '>> ColorMauve
  108. '>> Constant Values For FocusRect Vista
  109. Private Const BDR_FOCUSRECT_VISTA As Long = 16698372
  110. '>> Constant Values For FocusRect Xp
  111. Private Const BDR_BLUEXP_DARK As Long = &HD98D59
  112. Private Const BDR_BLUEXP_NORMAL1 As Long = &HE2A981
  113. Private Const BDR_BLUEXP_NORMAL2 As Long = &HF0D1B5
  114. Private Const BDR_BLUEXP_LIGHT1 As Long = &HF7D7BD
  115. Private Const BDR_BLUEXP_LIGHT2 As Long = &HFFE7CE
  116.  
  117. '............................................................
  118. '>> Constant Types For HandPointer
  119. Private Const CURSOR_HAND = 32649&
  120.  
  121. '............................................................
  122. '>> API Declare Function's
  123. Private Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
  124. Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
  125. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  126. Private Declare Function ScreenToClient Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
  127. Private Declare Function GetCapture& Lib "user32" ()
  128. Private Declare Function SetCapture& Lib "user32" (ByVal hWnd&)
  129. Private Declare Function ReleaseCapture& Lib "user32" ()
  130. Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
  131. Private Declare Function SetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal crColor As Long) As Long
  132. Private Declare Function GetTextExtentPoint32 Lib "gdi32" Alias "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As String, ByVal cbString As Long, lpSize As POINTAPI) As Long
  133. Private Declare Function TextOutW Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
  134. Private Declare Function TextOutA Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
  135. Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, lpPoint As POINTAPI) As Long
  136. Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
  137. Private Declare Function Arc Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
  138. Private Declare Function GradientFill Lib "msimg32" (ByVal hdc As Long, ByRef pVertex As TRIVERTEX, ByVal dwNumVertex As Long, pMesh As Any, ByVal dwNumMesh As Long, ByVal dwMode As Long) As Integer
  139. Private Declare Function TranslateColor Lib "olepro32.dll" Alias "OleTranslateColor" (ByVal clr As OLE_COLOR, ByVal palet As Long, Col As Long) As Long
  140. Private Declare Function CreatePolygonRgn Lib "gdi32" (lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
  141. Private Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
  142. Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
  143. Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  144. Private Declare Function RoundRect Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
  145. Private Declare Function SetWindowRgn Lib "user32" (ByVal hWnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
  146. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  147.  
  148. '............................................................
  149. '>> Button Declarations
  150. '............................................................
  151. Public Enum EnumButtonShape
  152.     Rectangle
  153.     RoundedRectangle
  154.     Round
  155.     Diamond
  156.     Top_Triangle
  157.     Left_Triangle
  158.     Right_Triangle
  159.     Down_Triangle
  160.     top_Arrow
  161.     Left_Arrow
  162.     Right_Arrow
  163.     Down_Arrow
  164. End Enum
  165. Public Enum EnumButtonStyle
  166.     Custom
  167.     Visual
  168.     Flat
  169.     OverFlat
  170.     Java
  171.     XPOffice
  172.     WinXp
  173.     Vista
  174.     Glass
  175. End Enum
  176. Public Enum EnumButtonStyleColors
  177.     Transparent
  178.     SingleColor
  179.     Gradient_H
  180.     Gradient_V
  181.     TubeCenter_H
  182.     TubeTopBottom_H
  183.     TubeCenter_V
  184.     TubeTopBottom_V
  185. End Enum
  186. Public Enum EnumButtonTheme
  187.     NoTheme
  188.     XpBlue
  189.     XpOlive
  190.     XPSilver
  191.     Visual2005
  192.     Norton2005
  193.     RedColor
  194.     GreenColor
  195.     BlueColor
  196. End Enum
  197. Public Enum EnumButtonType
  198.     Button
  199.     CheckBox
  200. End Enum
  201. Public Enum EnumCaptionAlignment
  202.     TopCaption
  203.     LeftCaption
  204.     CenterCaption
  205.     RightCaption
  206.     BottomCaption
  207. End Enum
  208. Public Enum EnumCaptionEffect
  209.     Default
  210.     Raised
  211.     Sunken
  212.     Outline
  213. End Enum
  214. Public Enum EnumCaptionStyle
  215.     Normal
  216.     HorizontalFill
  217.     VerticalFill
  218. End Enum
  219. Public Enum EnumDropDown
  220.     None
  221.     LeftDropDown
  222.     RightDropDown
  223. End Enum
  224. Public Enum EnumPictureAlignment
  225.     TopPicture
  226.     LeftPicture
  227.     CenterPicture
  228.     RightPicture
  229.     BottomPicture
  230. End Enum
  231. '............................................................
  232. '>> Property Member Variables
  233. '............................................................
  234. Private mButtonShape     As EnumButtonShape
  235. Private mButtonStyle     As EnumButtonStyle
  236. Private mButtonStyleColors As EnumButtonStyleColors
  237. Private mButtonTheme     As EnumButtonTheme
  238. Private mButtonType      As EnumButtonType
  239. Private mCaptionAlignment As EnumCaptionAlignment
  240. Private mCaptionEffect   As EnumCaptionEffect
  241. Private mCaptionStyle    As EnumCaptionStyle
  242. Private mDropDown        As EnumDropDown
  243. Private mPictureAlignment As EnumPictureAlignment
  244.  
  245. '............................................................
  246. '>> Property Color Variables
  247. Dim mBackColor           As OLE_COLOR
  248. Dim mBackColorPressed    As OLE_COLOR
  249. Dim mBackColorHover      As OLE_COLOR
  250. '............................................................
  251. Dim mBorderColor         As OLE_COLOR
  252. Dim mBorderColorPressed  As OLE_COLOR
  253. Dim mBorderColorHover    As OLE_COLOR
  254. '............................................................
  255. Dim mForeColor           As OLE_COLOR
  256. Dim mForeColorPressed    As OLE_COLOR
  257. Dim mForeColorHover      As OLE_COLOR
  258. '............................................................
  259. Dim mEffectColor         As OLE_COLOR
  260.  
  261. Dim mCaption             As String
  262. Dim mFocusRect           As Boolean
  263. Dim mFocused             As Boolean
  264. Dim mValue               As Boolean
  265. Dim mHandPointer         As Boolean
  266. Dim mPicture             As Picture
  267. Dim mPictureGray         As Boolean
  268. '............................................................
  269. Dim CaptionPos(1)        As POINTAPI                          '>> Postion Text
  270. Dim PicturePos(1)        As POINTAPI                          '>> Postion Picture
  271. Dim Fo                   As POINTAPI               '>> Region Of FocusRect
  272. '............................................................
  273. '>> Mouse Button >> Hovered Or Pressed
  274. Private MouseMove, MouseDown As Boolean
  275. Attribute MouseDown.VB_VarUserMemId = 1073938462
  276.  
  277. Dim P(0 To 7)            As POINTAPI
  278. Attribute P.VB_VarUserMemId = 1073938464
  279. Dim PL(0 To 7)           As POINTAPI
  280. Attribute PL.VB_VarUserMemId = 1073938465
  281. Dim Lines                As POINTAPI
  282. Attribute Lines.VB_VarUserMemId = 1073938466
  283. Dim hRgn                 As Long
  284. Attribute hRgn.VB_VarUserMemId = 1073938467
  285. '............................................................
  286. '>> Button Event Declaration's
  287. '............................................................
  288. Public Event Click()
  289. Public Event DblClick()
  290. Public Event KeyDown(KeyCode As Integer, Shift As Integer)
  291. Public Event KeyPress(KeyAscii As Integer)
  292. Public Event KeyUp(KeyCode As Integer, Shift As Integer)
  293. Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  294. Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  295. Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  296. Public Event OLECompleteDrag(Effect As Long)
  297. Public Event OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  298. Public Event OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  299. Public Event OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
  300. Public Event OLESetData(Data As DataObject, DataFormat As Integer)
  301. Public Event OLEStartDrag(Data As DataObject, AllowedEffects As Long)
  302. '............................................................
  303. '>> Start Properties Button
  304. '............................................................
  305. Public Property Get hdc() As Long
  306.     hdc = UserControl.hdc
  307. End Property
  308. Public Property Get hWnd() As Long
  309.     hWnd = UserControl.hWnd
  310. End Property
  311. Public Sub Refresh()
  312.     UserControl.Refresh
  313. End Sub
  314.  
  315. Public Property Get ButtonShape() As EnumButtonShape
  316.     ButtonShape = mButtonShape
  317. End Property
  318. Public Property Let ButtonShape(ByVal EBS As EnumButtonShape)
  319.     mButtonShape = EBS
  320.     PropertyChanged "ButtonShape"
  321.     UserControl_Paint
  322. End Property
  323. Public Property Get ButtonStyle() As EnumButtonStyle
  324.     ButtonStyle = mButtonStyle
  325. End Property
  326. Public Property Let ButtonStyle(ByVal EBS As EnumButtonStyle)
  327.     mButtonStyle = EBS
  328.     PropertyChanged "ButtonStyle"
  329.     '.............................................................
  330.     '>> ButtonStyle,Visual, Flat,OverFlat,Java,XpOffice,WinXp
  331.     '>> Vista,Glass
  332.     '>> Default BackColors To ButtonStyle At Hover,Press,Off
  333.     '>> 'Default ForeColors To ButtonStyle At Hover,Press,Off
  334.     '.............................................................
  335.     Select Case mButtonStyle
  336.         Case Is = Visual
  337.             mBackColor = vbButtonFace
  338.             mBackColorHover = vbButtonFace
  339.             mBackColorPressed = vbButtonFace
  340.             'mForeColor = vbBlack
  341.             'mForeColorHover = vbBlack
  342.             'mForeColorPressed = vbBlack
  343.         Case Is = Flat
  344.             mBackColor = vbButtonFace
  345.             mBackColorHover = vbButtonFace
  346.             mBackColorPressed = vbButtonFace
  347.             'mForeColor = vbBlack
  348.             ' mForeColorHover = vbBlack
  349.             'mForeColorPressed = vbBlack
  350.         Case Is = OverFlat
  351.             mBackColor = vbButtonFace
  352.             mBackColorHover = vbButtonFace
  353.             mBackColorPressed = vbButtonFace
  354.             'mForeColor = vbBlack
  355.             'mForeColorHover = vbBlack
  356.             'mForeColorPressed = vbBlack
  357.         Case Is = Java
  358.             If Not mButtonStyleColors = Transparent Then mButtonStyleColors = SingleColor
  359.             mBackColor = vbButtonFace
  360.             mBackColorHover = vbButtonFace
  361.             mBackColorPressed = &H999999
  362.             'mForeColor = vbBlack
  363.             'mForeColorHover = vbBlack
  364.             'mForeColorPressed = vbBlack
  365.         Case Is = XPOffice
  366.             mBackColor = vbButtonFace
  367.             mBackColorHover = &HB6A59F
  368.             mBackColorPressed = &HAF8C80
  369.             'mForeColor = vbBlack
  370.             'mForeColorHover = vbBlack
  371.             'mForeColorPressed = vbBlack
  372.         Case Is = WinXp
  373.             If Not mButtonStyleColors = Transparent Then mButtonStyleColors = Gradient_V
  374.             mBackColor = &HD2DEDD
  375.             mBackColorHover = vbWhite
  376.             mBackColorPressed = vbWhite
  377.             'mForeColor = vbBlack
  378.             'mForeColorHover = vbBlack
  379.             'mForeColorPressed = vbBlack
  380.         Case Is = Vista
  381.             mBackColor = &HD8D8D8
  382.             mBackColorHover = &HF7DBA5
  383.             mBackColorPressed = &HEFCE92
  384.             'mForeColor = &H8000000D    'vbhightlight
  385.             'mForeColorHover = &H8000000D
  386.             'mForeColorPressed = &H8000000D
  387.         Case Is = Glass
  388.             mBackColor = vbDesktop
  389.             mBackColorHover = vbDesktop
  390.             mBackColorPressed = vbDesktop
  391.             'mForeColor = vbWhite
  392.             'mForeColorHover = vbWhite
  393.             'mForeColorPressed = vbWhite
  394.     End Select
  395.     UserControl_Paint
  396. End Property
  397. Public Property Get ButtonStyleColors() As EnumButtonStyleColors
  398.     ButtonStyleColors = mButtonStyleColors
  399. End Property
  400. Public Property Let ButtonStyleColors(ByVal EBSC As EnumButtonStyleColors)
  401.     mButtonStyleColors = EBSC
  402.     PropertyChanged "ButtonStyleColors"
  403.     UserControl_Paint
  404. End Property
  405. Public Property Get ButtonTheme() As EnumButtonTheme
  406.     ButtonTheme = mButtonTheme
  407. End Property
  408. Public Property Let ButtonTheme(ByVal EBT As EnumButtonTheme)
  409.     mButtonTheme = EBT
  410.     PropertyChanged "ButtonTheme"
  411.     '.............................................................
  412.     '>> ButtonTheme,XpBlue,XpOlive,XPSilver,Visual2005,Norton2005
  413.     '>> RedColor,GreenColor,BlueColor.
  414.     '.............................................................
  415.     Select Case mButtonTheme
  416.         Case Is = XpBlue
  417.             mBackColor = &HF1B39A
  418.             mBackColorHover = &HFDF7F4
  419.             mBackColorPressed = &HFAE6DD
  420.             mBorderColor = &HF1B39A
  421.             mBorderColorHover = &HF1B39A
  422.             mBorderColorPressed = &HF1B39A
  423.         Case Is = XpOlive
  424.             mBackColor = &H3DB4A2
  425.             mBackColorHover = &HDFF4F2
  426.             mBackColorPressed = &HB8E7E0
  427.             mBorderColor = &H3DB4A2
  428.             mBorderColorHover = &H3DB4A2
  429.             mBorderColorPressed = &H3DB4A2
  430.         Case Is = XPSilver
  431.             mBackColor = &HB5A09D
  432.             mBackColorHover = &HF7F5F4
  433.             mBackColorPressed = &HECE7E6
  434.             mBorderColor = &HB5A09D
  435.             mBorderColorHover = mBorderColor
  436.             mBorderColorPressed = mBorderColor
  437.         Case Is = Visual2005
  438.             mBackColor = &HABC2C2
  439.             mBackColorHover = &HF2F8F8
  440.             mBackColorPressed = &HE6EDEE
  441.             mBorderColor = &HABC2C2
  442.             mBorderColorHover = mBorderColor
  443.             mBorderColorPressed = mBorderColor
  444.         Case Is = Norton2005
  445.             mBackColor = &H2C5F5
  446.             mBackColorHover = &HE2F9FF
  447.             mBackColorPressed = &HAFEFFE
  448.             mBorderColor = &H2C5F5
  449.             mBorderColorHover = mBorderColor
  450.             mBorderColorPressed = mBorderColor
  451.         Case Is = RedColor
  452.             mBackColor = &H26368B
  453.             mBackColorHover = &H4763FF
  454.             mBackColorPressed = &H425CEE
  455.             mBorderColor = vbRed
  456.             mBorderColorHover = mBorderColor
  457.             mBorderColorPressed = mBorderColor
  458.         Case Is = GreenColor
  459.             mBackColor = &H578B2E
  460.             mBackColorHover = &H9FFF54
  461.             mBackColorPressed = &H80CD43
  462.             mBorderColor = vbGreen
  463.             mBorderColorHover = mBorderColor
  464.             mBorderColorPressed = mBorderColor
  465.         Case Is = BlueColor
  466.             mBackColor = &H8B4027
  467.             mBackColorHover = &HFF7648
  468.             mBackColorPressed = &HCD5F3A
  469.             mBorderColor = vbBlue
  470.             mBorderColorHover = mBorderColor
  471.             mBorderColorPressed = mBorderColor
  472.     End Select
  473.     UserControl_Paint
  474. End Property
  475. Public Property Get ButtonType() As EnumButtonType
  476.     ButtonType = mButtonType
  477. End Property
  478. Public Property Let ButtonType(ByVal EBT As EnumButtonType)
  479.     mButtonType = EBT
  480.     PropertyChanged "ButtonType"
  481.     UserControl_Paint
  482. End Property
  483. Public Property Get CaptionAlignment() As EnumCaptionAlignment
  484.     CaptionAlignment = mCaptionAlignment
  485. End Property
  486. Public Property Let CaptionAlignment(ByVal ECA As EnumCaptionAlignment)
  487.     mCaptionAlignment = ECA
  488.     PropertyChanged "CaptionAlignment"
  489.     UserControl_Paint
  490. End Property
  491. Public Property Get CaptionEffect() As EnumCaptionEffect
  492.     CaptionEffect = mCaptionEffect
  493. End Property
  494. Public Property Let CaptionEffect(ByVal ECE As EnumCaptionEffect)
  495.     mCaptionEffect = ECE
  496.     PropertyChanged "CaptionEffect"
  497.     UserControl_Paint
  498. End Property
  499. Public Property Get CaptionStyle() As EnumCaptionStyle
  500.     CaptionStyle = mCaptionStyle
  501. End Property
  502. Public Property Let CaptionStyle(ByVal ECS As EnumCaptionStyle)
  503.     mCaptionStyle = ECS
  504.     PropertyChanged "CaptionStyle"
  505.     UserControl_Paint
  506. End Property
  507. Public Property Get DropDown() As EnumDropDown
  508.     DropDown = mDropDown
  509. End Property
  510. Public Property Let DropDown(ByVal EDD As EnumDropDown)
  511.     mDropDown = EDD
  512.     PropertyChanged "DropDown"
  513.     UserControl_Paint
  514. End Property
  515. Public Property Get PictureAlignment() As EnumPictureAlignment
  516.     PictureAlignment = mPictureAlignment
  517. End Property
  518. Public Property Let PictureAlignment(ByVal EPA As EnumPictureAlignment)
  519.     mPictureAlignment = EPA
  520.     PropertyChanged "PictureAlignment"
  521.     UserControl_Paint
  522. End Property
  523. Public Property Get BackColor() As OLE_COLOR
  524.     BackColor = mBackColor
  525. End Property
  526. Public Property Let BackColor(ByVal New_Color As OLE_COLOR)
  527.     mBackColor = New_Color
  528.     PropertyChanged "BackColor"
  529.     UserControl_Paint
  530. End Property
  531. Public Property Get BackColorPressed() As OLE_COLOR
  532.     BackColorPressed = mBackColorPressed
  533. End Property
  534. Public Property Let BackColorPressed(ByVal New_Color As OLE_COLOR)
  535.     mBackColorPressed = New_Color
  536.     PropertyChanged "BackColorPressed"
  537.     UserControl_Paint
  538. End Property
  539. Public Property Get BackColorHover() As OLE_COLOR
  540.     BackColorHover = mBackColorHover
  541. End Property
  542. Public Property Let BackColorHover(ByVal New_Color As OLE_COLOR)
  543.     mBackColorHover = New_Color
  544.     PropertyChanged "BackColorHover"
  545.     UserControl_Paint
  546. End Property
  547. Public Property Get BorderColor() As OLE_COLOR
  548.     BorderColor = mBorderColor
  549. End Property
  550. Public Property Let BorderColor(ByVal New_Color As OLE_COLOR)
  551.     mBorderColor = New_Color
  552.     PropertyChanged "BorderColor"
  553.     UserControl_Paint
  554. End Property
  555. Public Property Get BorderColorPressed() As OLE_COLOR
  556.     BorderColorPressed = mBorderColorPressed
  557. End Property
  558. Public Property Let BorderColorPressed(ByVal New_Color As OLE_COLOR)
  559.     mBorderColorPressed = New_Color
  560.     PropertyChanged "BorderColorPressed"
  561.     UserControl_Paint
  562. End Property
  563. Public Property Get BorderColorHover() As OLE_COLOR
  564.     BorderColorHover = mBorderColorHover
  565. End Property
  566. Public Property Let BorderColorHover(ByVal New_Color As OLE_COLOR)
  567.     mBorderColorHover = New_Color
  568.     PropertyChanged "BorderColorHover"
  569.     UserControl_Paint
  570. End Property
  571. Public Property Get ForeColor() As OLE_COLOR
  572.     ForeColor = mForeColor
  573. End Property
  574. Public Property Let ForeColor(ByVal New_Color As OLE_COLOR)
  575.     mForeColor = New_Color
  576.     PropertyChanged "ForeColor"
  577.     UserControl_Paint
  578. End Property
  579. Public Property Get ForeColorPressed() As OLE_COLOR
  580.     ForeColorPressed = mForeColorPressed
  581. End Property
  582. Public Property Let ForeColorPressed(ByVal New_Color As OLE_COLOR)
  583.     mForeColorPressed = New_Color
  584.     PropertyChanged "ForeColorPressed"
  585.     UserControl_Paint
  586. End Property
  587. Public Property Get ForeColorHover() As OLE_COLOR
  588.     ForeColorHover = mForeColorHover
  589. End Property
  590. Public Property Let ForeColorHover(ByVal New_Color As OLE_COLOR)
  591.     mForeColorHover = New_Color
  592.     PropertyChanged "ForeColorHover"
  593.     UserControl_Paint
  594. End Property
  595. Public Property Get EffectColor() As OLE_COLOR
  596.     EffectColor = mEffectColor
  597. End Property
  598. Public Property Let EffectColor(ByVal New_Color As OLE_COLOR)
  599.     mEffectColor = New_Color
  600.     PropertyChanged "EffectColor"
  601.     UserControl_Paint
  602. End Property
  603. Public Property Get Caption() As String
  604.     Caption = mCaption
  605. End Property
  606. Public Property Let Caption(ByVal NewCaption As String)
  607.     mCaption = NewCaption
  608.     PropertyChanged "Caption"
  609.     UserControl_Paint
  610. End Property
  611. Public Property Get FocusRect() As Boolean
  612.     FocusRect = mFocusRect
  613. End Property
  614. Public Property Let FocusRect(ByVal New_FocusRect As Boolean)
  615.     mFocusRect = New_FocusRect
  616.     PropertyChanged "FocusRect"
  617.     UserControl_Paint
  618. End Property
  619. Public Property Get Value() As Boolean
  620.     Value = mValue
  621. End Property
  622. Public Property Let Value(ByVal New_Value As Boolean)
  623.     mValue = New_Value
  624.     PropertyChanged "Value"
  625.     UserControl_Paint
  626. End Property
  627. Public Property Get HandPointer() As Boolean
  628.     HandPointer = mHandPointer
  629. End Property
  630. Public Property Let HandPointer(ByVal New_HandPointer As Boolean)
  631.     mHandPointer = New_HandPointer
  632.     PropertyChanged "HandPointer"
  633.     UserControl_Paint
  634. End Property
  635. Public Property Get Picture() As Picture
  636.     Set Picture = mPicture
  637. End Property
  638. Public Property Set Picture(ByVal New_Picture As Picture)
  639.     Set mPicture = New_Picture
  640.     PropertyChanged "Picture"
  641.     UserControl_Paint
  642. End Property
  643. Public Property Get PictureGray() As Boolean
  644.     PictureGray = mPictureGray
  645. End Property
  646. Public Property Let PictureGray(ByVal New_PictureGray As Boolean)
  647.     mPictureGray = New_PictureGray
  648.     PropertyChanged "PictureGray"
  649.     UserControl_Paint
  650. End Property
  651. '............................................................
  652. '............................................................
  653. Public Property Get Enabled() As Boolean
  654.     Enabled = UserControl.Enabled
  655. End Property
  656. Public Property Let Enabled(ByVal New_Enabled As Boolean)
  657.     UserControl.Enabled = New_Enabled
  658.     PropertyChanged "Enabled"
  659.     UserControl_Paint
  660. End Property
  661. Public Property Get Font() As Font
  662.     Set Font = UserControl.Font
  663. End Property
  664. Public Property Set Font(ByVal New_Font As Font)
  665.     Set UserControl.Font = New_Font
  666.     PropertyChanged "Font"
  667.     UserControl_Paint
  668. End Property
  669. Public Property Get MousePointer() As MousePointerConstants
  670.     MousePointer = UserControl.MousePointer
  671. End Property
  672. Public Property Let MousePointer(ByVal New_MousePointer As MousePointerConstants)
  673.     UserControl.MousePointer() = New_MousePointer
  674.     PropertyChanged "MousePointer"
  675.     UserControl_Paint
  676. End Property
  677. Public Property Get MouseIcon() As Picture
  678.     Set MouseIcon = UserControl.MouseIcon
  679. End Property
  680. Public Property Set MouseIcon(ByVal New_MouseIcon As Picture)
  681.     Set UserControl.MouseIcon() = New_MouseIcon
  682.     PropertyChanged "MouseIcon"
  683.     UserControl_Paint
  684. End Property
  685. '............................................................
  686. '>> End Properties
  687. '............................................................
  688.  
  689. '............................................................
  690. '>> Convert Color's >> Red,Green,Blue To VB Color's
  691. '............................................................
  692. Private Sub ConvertRGB(ByVal Color As Long, R, G, B As Long)
  693.     TranslateColor Color, 0, Color
  694.     R = Color And vbRed
  695.     G = (Color And vbGreen) / 256
  696.     B = (Color And vbBlue) / 65536
  697. End Sub
  698. '............................................................
  699. '>> Start UserControl
  700. '............................................................
  701. Private Sub UserControl_Click()
  702.     '>> Start The Button Pressed
  703.     If Me.ButtonType = CheckBox Then mValue = MouseDown = False
  704.     UserControl_Paint
  705.     RaiseEvent Click
  706. End Sub
  707. Private Sub UserControl_DblClick()
  708.     '>> Start The Button Pressed Too
  709.     MouseDown = True
  710.     UserControl_Paint
  711.     RaiseEvent DblClick
  712. End Sub
  713. Private Sub UserControl_GotFocus()
  714.     '>> Show FocusRect If Click Button
  715.     mFocused = True
  716.     UserControl_Paint
  717. End Sub
  718. Private Sub UserControl_KeyDown(KeyCode As Integer, Shift As Integer)
  719.     If KeyCode = 32 Or KeyCode = 13 Then                   '>> Space Or '>> Enter
  720.         MouseDown = True
  721.         UserControl_Paint
  722.     End If
  723.     RaiseEvent KeyDown(KeyCode, Shift)
  724. End Sub
  725. Private Sub UserControl_KeyPress(KeyAscii As Integer)
  726.     RaiseEvent KeyPress(KeyAscii)
  727. End Sub
  728. Private Sub UserControl_KeyUp(KeyCode As Integer, Shift As Integer)
  729.     If MouseDown = True Then
  730.         MouseDown = False
  731.         UserControl_Paint
  732.         '>> Return Button To Original Shape If ButtonType >> CheckBox
  733.         If KeyCode = vbKeyReturn Then UserControl_MouseDown 0, 0, 0, 0
  734.     End If
  735.     RaiseEvent KeyUp(KeyCode, Shift)
  736. End Sub
  737. Private Sub UserControl_LostFocus()
  738.     '>> Visible FocusRect If Clicked Another Button
  739.     mFocused = False
  740.     UserControl_Paint
  741. End Sub
  742. Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  743.     '>> Start The Button Pressed
  744.     MouseDown = True
  745.     UserControl_Paint
  746.     RaiseEvent MouseDown(Button, Shift, X, Y)
  747. End Sub
  748. Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  749.     Dim pt               As POINTAPI
  750.     Dim Hovered          As Boolean                         '>> False Or Ture
  751.     With UserControl
  752.         GetCursorPos pt
  753.         ScreenToClient .hWnd, pt
  754.         '>> We Don't Need To Check Postion Mouse
  755.         If Not UserControl.Ambient.UserMode Then Exit Sub
  756.         ' See If The Mouse Is Over The Control
  757.         If (pt.X < 0) Or (pt.Y < 0) Or (pt.X > .ScaleWidth) Or (pt.Y > .ScaleHeight) Then
  758.             Hovered = False                                '>> Mouse Is Leave Of Button
  759.             ReleaseCapture
  760.         Else
  761.             Hovered = True                                 '>> Mouse Over Button
  762.             SetCapture .hWnd
  763.         End If
  764.         ' Redraw The Control If Necessary
  765.         If MouseMove <> Hovered Then
  766.             MouseMove = Hovered
  767.             MouseDown = False
  768.             UserControl_Paint
  769.         End If
  770.     End With
  771.     RaiseEvent MouseMove(Button, Shift, X, Y)
  772. End Sub
  773. Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
  774.     If GetCapture() <> UserControl.hWnd Then SetCapture UserControl.hWnd
  775.     Dim Pressed          As Boolean
  776.     ' Raise The Click Event If The Button Is Currently Pressed
  777.     If Pressed Then RaiseEvent Click
  778.     Pressed = MouseDown
  779.     ' Stop The Button Pressed
  780.     MouseDown = False
  781.     UserControl_Paint
  782.     RaiseEvent MouseUp(Button, Shift, X, Y)
  783. End Sub
  784. Private Sub UserControl_InitProperties()
  785.     'On Local Error Resume Next
  786.     UserControl.Width = 1200
  787.     UserControl.Height = 500
  788.  
  789.     mButtonShape = Rectangle
  790.     mButtonStyle = Visual
  791.     mButtonStyleColors = SingleColor
  792.     mButtonTheme = NoTheme
  793.     mButtonType = Button
  794.     mCaptionAlignment = CenterCaption
  795.     mCaptionStyle = Normal
  796.     mCaptionEffect = Default
  797.     mDropDown = None
  798.     mPictureAlignment = CenterPicture
  799.  
  800.     mBackColor = vbButtonFace
  801.     mBackColorPressed = vbButtonFace
  802.     mBackColorHover = vbButtonFace
  803.  
  804.     'mBorderColor = vbBlack
  805.     'mBorderColorHover = vbBlack
  806.     'mBorderColorPressed = vbBlack
  807.  
  808.     mForeColor = vbBlack
  809.     mForeColorPressed = vbRed
  810.     mForeColorHover = vbBlue
  811.     mEffectColor = vbWhite
  812.  
  813.     mCaption = Ambient.DisplayName
  814.     mFocusRect = True
  815.     mValue = False
  816.     mHandPointer = False
  817.     Set mPicture = Nothing
  818.     mPictureGray = False
  819.     UserControl.Enabled = True
  820.     UserControl.Font = "Tahoma"
  821.     UserControl_Paint
  822. End Sub
  823. Private Sub UserControl_OLECompleteDrag(Effect As Long)
  824.     RaiseEvent OLECompleteDrag(Effect)
  825. End Sub
  826. Private Sub UserControl_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  827.     RaiseEvent OLEDragDrop(Data, Effect, Button, Shift, X, Y)
  828. End Sub
  829. Private Sub UserControl_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer)
  830.     RaiseEvent OLEDragOver(Data, Effect, Button, Shift, X, Y, State)
  831. End Sub
  832. Private Sub UserControl_OLEGiveFeedback(Effect As Long, DefaultCursors As Boolean)
  833.     RaiseEvent OLEGiveFeedback(Effect, DefaultCursors)
  834. End Sub
  835. Private Sub UserControl_OLESetData(Data As DataObject, DataFormat As Integer)
  836.     RaiseEvent OLESetData(Data, DataFormat)
  837. End Sub
  838. Private Sub UserControl_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
  839.     RaiseEvent OLEStartDrag(Data, AllowedEffects)
  840. End Sub
  841. Private Sub UserControl_Paint()
  842.     'On Local Error Resume Next
  843.     With UserControl
  844.         .AutoRedraw = True
  845.         .ScaleMode = 3
  846.         .Cls
  847.         '............................................................
  848.         '>> Width = Height To Nice Show Border's.
  849.         '............................................................
  850.         If .Width < 375 Then .Width = 375
  851.         If .Height < 375 Then .Height = 375
  852.         If Not mButtonShape = Rectangle Then
  853.             If Not mButtonShape = RoundedRectangle Then
  854.                 If .Width > .Height Then .Height = .Width Else .Height = .Width
  855.             End If
  856.         End If
  857.         '............................................................
  858.         '>> Change MousePointer To HandCursor
  859.         '............................................................
  860.         If MouseDown Then
  861.             If mFocused And mHandPointer Then SetCursor LoadCursor(0, CURSOR_HAND)
  862.         ElseIf MouseMove Then
  863.             If mHandPointer Then SetCursor LoadCursor(0, CURSOR_HAND)
  864.         Else
  865.             If mFocused And mHandPointer Then SetCursor LoadCursor(0, CURSOR_HAND)
  866.         End If
  867.         '............................................................
  868.         '>> Use Value For Viwe CheckBox(ButtonPressed) At TimeShow
  869.         '............................................................
  870.         Select Case mButtonType
  871.             Case Is = CheckBox
  872.                 If mValue Then MouseDown = True
  873.         End Select
  874.         '............................................................
  875.         '>> Change BackColor When Mouse Hovered Or Pressed Or Off
  876.         '............................................................
  877.         Dim BkRed(0 To 1), BkGreen(0 To 1), BkBlue(0 To 1) As Long
  878.         Dim vert(1) As TRIVERTEX, GRect As GRADIENT_RECT
  879.         If MouseDown Then
  880.             ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  881.             ConvertRGB mBackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  882.         ElseIf MouseMove Then
  883.             ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  884.             ConvertRGB mBackColorHover, BkRed(1), BkGreen(1), BkBlue(1)
  885.         Else
  886.             ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  887.             ConvertRGB mBackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  888.         End If
  889.         vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  890.         vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  891.         GRect.UpperLeft = 1: GRect.LowerRight = 0
  892.         '............................................................
  893.         '>> ButtonStyleColors,Transparent,SingleColour
  894.         '>> GradientHorizontalFill,VerticalGradientFill
  895.         '>> SwapHorizontalFill,SwapVerticalFill,GradientTubeCenter_H
  896.         '>> ,GradientTubeTopBottom_H,GradientTubeCenter_V
  897.         '>> GradientTubeTopBottom_V
  898.         '............................................................
  899.         Select Case mButtonStyleColors
  900.             Case Is = Transparent
  901.                 .BackStyle = 0
  902.             Case Is = SingleColor
  903.                 .BackStyle = 1
  904.                 If MouseDown Then
  905.                     .BackColor = mBackColorPressed
  906.                 Else
  907.                     If MouseMove Then
  908.                         .BackColor = mBackColorHover
  909.                     Else
  910.                         .BackColor = mBackColor
  911.                     End If
  912.                 End If
  913.             Case Is = Gradient_H
  914.                 .BackStyle = 1
  915.                 vert(0).X = 0: vert(0).Y = .ScaleHeight
  916.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  917.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  918.             Case Is = Gradient_V
  919.                 .BackStyle = 1
  920.                 vert(0).X = 0: vert(0).Y = .ScaleHeight
  921.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  922.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  923.             Case Is = TubeCenter_H
  924.                 .BackStyle = 1
  925.                 vert(0).X = .ScaleWidth: vert(0).Y = 0
  926.                 vert(1).X = 0: vert(1).Y = .ScaleHeight / 2
  927.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  928.                 vert(0).X = 0: vert(0).Y = .ScaleHeight
  929.                 vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight / 2
  930.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  931.             Case Is = TubeTopBottom_H
  932.                 .BackStyle = 1
  933.                 vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  934.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  935.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  936.                 vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  937.                 vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight
  938.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  939.             Case Is = TubeCenter_V
  940.                 .BackStyle = 1
  941.                 vert(0).X = 0: vert(0).Y = 0
  942.                 vert(1).X = .ScaleWidth / 2: vert(1).Y = .ScaleHeight
  943.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  944.                 vert(0).X = .ScaleWidth: vert(0).Y = .ScaleHeight
  945.                 vert(1).X = .ScaleWidth / 2: vert(1).Y = 0
  946.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  947.             Case Is = TubeTopBottom_V
  948.                 .BackStyle = 1
  949.                 vert(0).X = .ScaleWidth / 2: vert(0).Y = 0
  950.                 vert(1).X = 0: vert(1).Y = .ScaleHeight
  951.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  952.                 vert(0).X = .ScaleWidth / 2: vert(0).Y = .ScaleHeight
  953.                 vert(1).X = .ScaleWidth: vert(1).Y = 0
  954.                 GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  955.         End Select
  956.         '.............................................................
  957.         '>> ButtonStyle,Visual, Flat,OverFlat,Java,XpOffice,WinXp
  958.         '>> Vista,Glass
  959.         '>> Set BorderColors To ButtonStyle At Hover,Press,Off
  960.         '.............................................................
  961.         Select Case mButtonStyle
  962.             Case Is = Visual
  963.                 mBorderColor = vb3DDKShadow
  964.                 mBorderColorHover = vb3DDKShadow
  965.                 mBorderColorPressed = vb3DHighlight
  966.             Case Is = Flat
  967.                 mBorderColor = vb3DDKShadow
  968.                 mBorderColorHover = vb3DDKShadow
  969.                 mBorderColorPressed = vb3DHighlight
  970.             Case Is = OverFlat
  971.                 mBorderColor = mBackColor    '>> Visible BorderColor At RunTime
  972.                 mBorderColorHover = vb3DDKShadow
  973.                 mBorderColorPressed = vb3DHighlight
  974.             Case Is = Java
  975.                 mBorderColor = vbButtonShadow
  976.                 mBorderColorHover = vbButtonShadow
  977.                 mBorderColorPressed = vbButtonShadow
  978.             Case Is = XPOffice
  979.                 mBorderColor = vbButtonFace
  980.                 mBorderColorHover = vbBlack
  981.                 mBorderColorPressed = vbBlack
  982.                 '............................................................
  983.                 '>> Change BackColor XpOffice When Mouse Hovered,Pressed,Off
  984.                 '............................................................
  985.                 If Not mButtonStyleColors = Transparent Then
  986.                     If MouseDown Then
  987.                         ConvertRGB &HA57F71, BkRed(0), BkGreen(0), BkBlue(0)
  988.                         ConvertRGB mBackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  989.                     ElseIf MouseMove Then
  990.                         ConvertRGB &HAC9891, BkRed(0), BkGreen(0), BkBlue(0)
  991.                         ConvertRGB mBackColorHover, BkRed(1), BkGreen(1), BkBlue(1)
  992.                     Else
  993.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  994.                         ConvertRGB mBackColor, BkRed(1), BkGreen(1), BkBlue(1)
  995.                     End If
  996.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  997.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  998.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  999.                     vert(0).X = 0: vert(0).Y = .ScaleHeight
  1000.                     vert(1).X = .ScaleWidth: vert(1).Y = 0
  1001.                     GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1002.                 End If
  1003.             Case Is = WinXp
  1004.                 mBorderColor = vbBlack
  1005.                 mBorderColorHover = vbBlack
  1006.                 mBorderColorPressed = vbBlack
  1007.                 '............................................................
  1008.                 '>> Change BackColor WinXp When Mouse Hovered,Pressed,Off
  1009.                 '............................................................
  1010.                 If Not mButtonStyleColors = Transparent Then
  1011.                     If MouseDown Then
  1012.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1013.                         ConvertRGB &HE0E6E6, BkRed(1), BkGreen(1), BkBlue(1)
  1014.                     ElseIf .Enabled Then
  1015.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1016.                         ConvertRGB Me.BackColorPressed, BkRed(1), BkGreen(1), BkBlue(1)
  1017.                     Else
  1018.                         ConvertRGB &HDBE7E7, BkRed(0), BkGreen(0), BkBlue(0)
  1019.                         ConvertRGB &HDBE7E7, BkRed(1), BkGreen(1), BkBlue(1)
  1020.                         mBorderColor = &H8DABAB
  1021.                     End If
  1022.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  1023.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  1024.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  1025.                     vert(0).X = 0: vert(0).Y = .ScaleHeight
  1026.                     vert(1).X = .ScaleWidth: vert(1).Y = 0
  1027.                     GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1028.                 End If
  1029.             Case Is = Vista
  1030.                 mBorderColor = &H8F8F8E
  1031.                 mBorderColorHover = &HB17F3C
  1032.                 mBorderColorPressed = &H5C411D
  1033.                 '............................................................
  1034.                 '>> Change BackColor Vista When Mouse Hovered,Pressed,Off
  1035.                 '............................................................
  1036.                 If Me.ButtonStyle = Vista And Not Me.ButtonStyleColors = Transparent Then
  1037.                     If MouseDown Then
  1038.                         ConvertRGB &HF8ECD5, BkRed(1), BkGreen(1), BkBlue(1)
  1039.                         ConvertRGB mBackColorPressed, BkRed(0), BkGreen(0), BkBlue(0)
  1040.                     ElseIf MouseMove Then
  1041.                         ConvertRGB &HFEFCF7, BkRed(1), BkGreen(1), BkBlue(1)
  1042.                         ConvertRGB mBackColorHover, BkRed(0), BkGreen(0), BkBlue(0)
  1043.                     ElseIf .Enabled Then
  1044.                         ConvertRGB &HEFEFEF, BkRed(1), BkGreen(1), BkBlue(1)
  1045.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1046.                     Else
  1047.                         ConvertRGB &HF4F4F4, BkRed(1), BkGreen(1), BkBlue(1)
  1048.                         ConvertRGB &HF0F0F0, BkRed(0), BkGreen(0), BkBlue(0)
  1049.                         mBorderColor = &HB5B2AD
  1050.                     End If
  1051.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  1052.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  1053.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  1054.                     If mButtonShape = Top_Triangle Or mButtonShape = Down_Triangle _
  1055.                             Or mButtonShape = top_Arrow Or mButtonShape = Down_Arrow Then
  1056.                         vert(0).X = .ScaleWidth / 1.5: vert(0).Y = 0
  1057.                         vert(1).X = 0: vert(1).Y = .ScaleHeight
  1058.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1059.                         vert(0).X = .ScaleWidth / 2: vert(0).Y = .ScaleHeight
  1060.                         vert(1).X = .ScaleWidth + 25: vert(1).Y = 0
  1061.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1062.                     Else
  1063.                         vert(0).X = 0: vert(0).Y = .ScaleHeight / 1.5
  1064.                         vert(1).X = .ScaleWidth: vert(1).Y = 0
  1065.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1066.                         vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  1067.                         vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight + 25
  1068.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1069.                     End If
  1070.                 End If
  1071.             Case Is = Glass
  1072.                 mBorderColor = mBackColor
  1073.                 mBorderColorHover = mBackColorHover
  1074.                 mBorderColorPressed = mBackColorPressed
  1075.                 '............................................................
  1076.                 '>> Change BackColor Glass When Mouse Hovered,Pressed,Off
  1077.                 '............................................................
  1078.                 If Not mButtonStyleColors = Transparent Then
  1079.                     If MouseDown Then
  1080.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1081.                         ConvertRGB mBackColorPressed, BkRed(0), BkGreen(0), BkBlue(0)
  1082.                     ElseIf MouseMove Then
  1083.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1084.                         ConvertRGB mBackColorHover, BkRed(0), BkGreen(0), BkBlue(0)
  1085.                     ElseIf .Enabled Then
  1086.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1087.                         ConvertRGB mBackColor, BkRed(0), BkGreen(0), BkBlue(0)
  1088.                     Else
  1089.                         ConvertRGB vbWhite, BkRed(1), BkGreen(1), BkBlue(1)
  1090.                         ConvertRGB &HA4B6B7, BkRed(0), BkGreen(0), BkBlue(0)
  1091.                         mBorderColor = &HA4B6B7
  1092.                     End If
  1093.                     vert(0).Red = val("&H" & Hex(BkRed(0)) & "00"): vert(0).Green = val("&H" & Hex(BkGreen(0)) & "00"): vert(0).Blue = val("&H" & Hex(BkBlue(0)) & "00"): vert(0).Alpha = 0&
  1094.                     vert(1).Red = val("&H" & Hex(BkRed(1)) & "00"): vert(1).Green = val("&H" & Hex(BkGreen(1)) & "00"): vert(1).Blue = val("&H" & Hex(BkBlue(1)) & "00"): vert(1).Alpha = 0&
  1095.                     GRect.UpperLeft = 1: GRect.LowerRight = 0
  1096.                     If mButtonShape = Top_Triangle Or mButtonShape = Down_Triangle _
  1097.                             Or mButtonShape = top_Arrow Or mButtonShape = Down_Arrow Then
  1098.                         vert(0).X = .ScaleWidth: vert(0).Y = 0
  1099.                         vert(1).X = -.ScaleWidth / 6: vert(1).Y = .ScaleHeight
  1100.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1101.                         vert(0).X = .ScaleWidth / 2: vert(0).Y = .ScaleHeight
  1102.                         vert(1).X = .ScaleWidth + .ScaleWidth / 3: vert(1).Y = 0
  1103.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_H
  1104.                     Else
  1105.                         vert(0).X = 0: vert(0).Y = .ScaleHeight
  1106.                         vert(1).X = .ScaleWidth: vert(1).Y = -.ScaleHeight / 6
  1107.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1108.                         vert(0).X = 0: vert(0).Y = .ScaleHeight / 2
  1109.                         vert(1).X = .ScaleWidth: vert(1).Y = .ScaleHeight + .ScaleHeight / 3
  1110.                         GradientFill .hdc, vert(0), 2, GRect, 1, GRADIENT_FILL_RECT_V
  1111.                     End If
  1112.                 End If
  1113.         End Select
  1114.         '............................................................
  1115.         '>> Get Postion Picture
  1116.         '............................................................
  1117.         If mPicture Is Nothing Then
  1118.             PicturePos(1).X = 0
  1119.             PicturePos(1).Y = 0
  1120.         Else
  1121.             PicturePos(1).X = ScaleX(mPicture.Width, vbHimetric, vbPixels)
  1122.             PicturePos(1).Y = ScaleY(mPicture.Height, vbHimetric, vbPixels)
  1123.             '............................................................
  1124.             '>> PictureAlignment,Top PictureLeft Picture,Center Picture
  1125.             '>> Right Picture,Bottom Picture
  1126.             '............................................................
  1127.             Select Case mPictureAlignment
  1128.                 Case Is = TopPicture
  1129.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / 2
  1130.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / .ScaleHeight + 4
  1131.                 Case Is = LeftPicture
  1132.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / .ScaleWidth + 4
  1133.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / 2
  1134.                 Case Is = CenterPicture
  1135.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / 2
  1136.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / 2
  1137.                 Case Is = RightPicture
  1138.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) - 5
  1139.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) / 2
  1140.                 Case Is = BottomPicture
  1141.                     PicturePos(0).X = (.ScaleWidth - PicturePos(1).X) / 2
  1142.                     PicturePos(0).Y = (.ScaleHeight - PicturePos(1).Y) - 5
  1143.             End Select
  1144.             '............................................................
  1145.             '>> Moving The Picture When Mouse Hovered Or Pressed
  1146.             '............................................................
  1147.             If Enabled = True Then
  1148.                 Dim GrPic As POINTAPI
  1149.                 Dim Gray As Long
  1150.                 If MouseDown Then
  1151.                     .PaintPicture mPicture, PicturePos(0).X + 1, PicturePos(0).Y + 1    '>> +1 Pixel To Top And Right
  1152.                 ElseIf MouseMove Then
  1153.                     .PaintPicture mPicture, PicturePos(0).X, PicturePos(0).Y
  1154.                     '>> If mButtonStyle = XPOffice Then -1 Pixel About Postion Picture When Mouse Hovered
  1155.                     If mButtonStyle = XPOffice Then .PaintPicture mPicture, PicturePos(0).X - 1, PicturePos(0).Y - 1
  1156.                 Else
  1157.                     .PaintPicture mPicture, PicturePos(0).X, PicturePos(0).Y
  1158.                     '>> Add Little Of Code's To Draw GrayScale Picture.
  1159.                     If mPictureGray = True Then
  1160.                         For GrPic.X = PicturePos(0).X To PicturePos(0).X + PicturePos(1).X
  1161.                             For GrPic.Y = PicturePos(0).Y To PicturePos(0).Y + PicturePos(1).Y
  1162.                                 Gray = 255 And (GetPixel(.hdc, GrPic.X, GrPic.Y))
  1163.                                 'Gray = vbRed And (GetPixel(.hDC, GrPic.X, GrPic.Y))
  1164.                                 If GetPixel(.hdc, GrPic.X, GrPic.Y) <> mBackColor Then
  1165.                                     SetPixel hdc, GrPic.X, GrPic.Y, RGB(Gray, Gray, Gray)
  1166.                                 End If
  1167.                             Next GrPic.Y
  1168.                         Next GrPic.X
  1169.                     End If
  1170.                 End If
  1171.             Else                                               '>> If Enabled = False Then
  1172.                 '............................................................
  1173.                 '>> Converting Picture Colour's To Black Color If Button
  1174.                 '>> Disabled
  1175.                 '............................................................
  1176.                 .PaintPicture mPicture, PicturePos(0).X, PicturePos(0).Y
  1177.                 For GrPic.X = PicturePos(0).X To PicturePos(0).X + PicturePos(1).X
  1178.                     For GrPic.Y = PicturePos(0).Y To PicturePos(0).Y + PicturePos(1).Y
  1179.                         Gray = 255 And (GetPixel(.hdc, GrPic.X, GrPic.Y)) / 65536
  1180.                         If GetPixel(.hdc, GrPic.X, GrPic.Y) <> mBackColor Then
  1181.                             SetPixel hdc, GrPic.X, GrPic.Y, RGB(Gray, Gray, Gray)
  1182.                         End If
  1183.                     Next GrPic.Y
  1184.                 Next GrPic.X
  1185.             End If
  1186.         End If
  1187.         '............................................................
  1188.         '>> CaptionAlignment,Get Size And Postion Text,Top Text
  1189.         '>>Left Text,Center Text,Right Text,Bottom Text
  1190.         '............................................................
  1191.         If Len(mCaption) < 0 Then Exit Sub
  1192.         Select Case mCaptionAlignment
  1193.             Case Is = TopCaption
  1194.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1195.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / 2
  1196.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / .ScaleHeight + 5
  1197.             Case Is = LeftCaption
  1198.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1199.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / .ScaleWidth + 5
  1200.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / 2
  1201.             Case Is = CenterCaption
  1202.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1203.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / 2
  1204.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / 2
  1205.             Case Is = RightCaption
  1206.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1207.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) - 5
  1208.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) / 2
  1209.             Case Is = BottomCaption
  1210.                 GetTextExtentPoint32 .hdc, mCaption, Len(mCaption), CaptionPos(1)
  1211.                 CaptionPos(0).X = (.ScaleWidth - CaptionPos(1).X) / 2
  1212.                 CaptionPos(0).Y = (.ScaleHeight - CaptionPos(1).Y) - 5
  1213.         End Select
  1214.         '............................................................
  1215.         '>> CaptionEffect,Default,Raised,Sunken,Outline
  1216.         '............................................................
  1217.         Dim EFF          As POINTAPI
  1218.         If Enabled = True Then
  1219.             Select Case mCaptionEffect
  1220.                 Case Is = Default
  1221.                     If MouseDown Then
  1222.                         .ForeColor = mForeColorPressed
  1223.                         TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1224.                     ElseIf MouseMove Then
  1225.                         .ForeColor = mForeColorHover
  1226.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1227.                     Else
  1228.                         .ForeColor = mForeColor
  1229.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1230.                     End If
  1231.                 Case Is = Raised
  1232.                     EFF.X = -1                             '>> -1 Pixel From Down To Top
  1233.                     EFF.Y = -1                             '>> -1 Pixel From Right To Left
  1234.                     If MouseDown Then
  1235.                         .ForeColor = mEffectColor          '>> Vbwhite
  1236.                         TextOutW .hdc, CaptionPos(0).X + EFF.X + 1, CaptionPos(0).Y + EFF.Y + 1, mCaption, Len(mCaption)
  1237.                         .ForeColor = mForeColorPressed       '>> mForeColorPressed If You Like.
  1238.                         TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1239.                     ElseIf MouseMove Then
  1240.                         .ForeColor = mEffectColor          '>> Vbwhite
  1241.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1242.                         .ForeColor = mForeColorHover
  1243.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1244.                     Else
  1245.                         .ForeColor = mEffectColor
  1246.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1247.                         .ForeColor = mForeColor
  1248.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1249.                     End If
  1250.                 Case Is = Sunken
  1251.                     EFF.X = 1                              '>> +1 Pixel From Top To Down
  1252.                     EFF.Y = 1                              '>> +1 Pixel From Left To Right
  1253.                     If MouseDown Then
  1254.                         .ForeColor = mEffectColor          '>> Vbwhite
  1255.                         TextOutW .hdc, CaptionPos(0).X + EFF.X + 1, CaptionPos(0).Y + EFF.Y + 1, mCaption, Len(mCaption)
  1256.                         .ForeColor = mForeColorPressed       '>> mForeColorPressed
  1257.                         TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1258.                     ElseIf MouseMove Then
  1259.                         .ForeColor = mEffectColor          '>> Vbwhite
  1260.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1261.                         .ForeColor = mForeColorHover
  1262.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1263.                     Else
  1264.                         .ForeColor = mEffectColor
  1265.                         TextOutW .hdc, CaptionPos(0).X + EFF.X, CaptionPos(0).Y + EFF.Y, mCaption, Len(mCaption)
  1266.                         .ForeColor = mForeColor
  1267.                         TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1268.                     End If
  1269.                 Case Is = Outline
  1270.                     Dim Out As POINTAPI
  1271.                     For Out.X = -1 To 1                    '>> -1 Pixel And +1 Pixel From Top To Down
  1272.                         For Out.Y = -1 To 1                '>> -1 Pixel And +1 Pixel From Left To Right
  1273.                             If MouseDown Then
  1274.                                 .ForeColor = mEffectColor
  1275.                                 TextOutW .hdc, CaptionPos(0).X + Out.X + 1, CaptionPos(0).Y + Out.Y + 1, mCaption, Len(mCaption)
  1276.                                 .ForeColor = mForeColorPressed
  1277.                                 TextOutA .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1278.                             ElseIf MouseMove Then
  1279.                                 .ForeColor = mEffectColor
  1280.                                 TextOutW .hdc, CaptionPos(0).X + Out.X, CaptionPos(0).Y + Out.Y, mCaption, Len(mCaption)
  1281.                                 .ForeColor = mForeColorHover
  1282.                                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1283.                             Else
  1284.                                 .ForeColor = mEffectColor
  1285.                                 TextOutW .hdc, CaptionPos(0).X + Out.X, CaptionPos(0).Y + Out.Y, mCaption, Len(mCaption)
  1286.                                 .ForeColor = mForeColor
  1287.                                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1288.                             End If
  1289.                         Next Out.Y
  1290.                     Next Out.X
  1291.             End Select
  1292.         Else    '>> If Enabled = False Then >> Draw Disabled Text Sunken Look
  1293.             If mButtonStyle = Java Or mButtonStyle = WinXp Or _
  1294.                     mButtonStyle = Vista Or mButtonStyle = Glass Then
  1295.                 .ForeColor = vb3DShadow
  1296.                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1297.             Else    '>> If Enabled = False Then >> Draw Disabled Text Sunken Look
  1298.                 .ForeColor = vb3DHighlight
  1299.                 TextOutW .hdc, CaptionPos(0).X + 1, CaptionPos(0).Y + 1, mCaption, Len(mCaption)
  1300.                 .ForeColor = vb3DShadow
  1301.                 TextOutA .hdc, CaptionPos(0).X, CaptionPos(0).Y, mCaption, Len(mCaption)
  1302.             End If
  1303.         End If
  1304.         '............................................................
  1305.         '>> Change ForeColor When Mouse Hovered Or Pressed Or Off
  1306.         '............................................................
  1307.         Dim TotalRed(1), TotalGreen(1), TotalBlue(1) As Long
  1308.         Dim R(1), G(1), B(1) As Long
  1309.         Dim FrRed, FrGreen, FrBlue As Integer
  1310.         Dim Pos(1)       As POINTAPI
  1311.         Dim Fore         As POINTAPI
  1312.         '............................................................
  1313.         '>> CaptionStyle,SingleColour,GradientHorizontalFill
  1314.         '>> GradientVerticalFill
  1315.         '............................................................
  1316.         Select Case mCaptionStyle
  1317.             Case Is = Normal                      '>> SingleColour >> MouseOff,MouseMove,MouseDown
  1318.                 'We Don't Need To Any More Event's Here
  1319.                 '>> Look To Event's '>> mCaptionEffect = Default
  1320.             Case Is = HorizontalFill                       '>> GradientFill Len(Caption)
  1321.                 If MouseDown Then
  1322.                     ConvertRGB mForeColor, R(1), G(1), B(1)
  1323.                     ConvertRGB mForeColorPressed, R(0), G(0), B(0)
  1324.                 ElseIf MouseMove Then
  1325.                     ConvertRGB mForeColor, R(1), G(1), B(1)
  1326.                     ConvertRGB mForeColorHover, R(0), G(0), B(0)
  1327.                 Else
  1328.                     ConvertRGB mForeColor, R(1), G(1), B(1)
  1329.                     ConvertRGB mForeColorPressed, R(0), G(0), B(0)
  1330.                 End If
  1331.                 For Fore.X = CaptionPos(0).X To CaptionPos(0).X + CaptionPos(1).X
  1332.                     For Fore.Y = CaptionPos(0).Y To CaptionPos(0).Y + CaptionPos(1).Y
  1333.                         TotalRed(0) = (R(0) - R(1)) / .ScaleWidth * Fore.X
  1334.                         TotalGreen(0) = (G(0) - G(1)) / .ScaleWidth * Fore.X
  1335.                         TotalBlue(0) = (B(0) - B(1)) / .ScaleWidth * Fore.X
  1336.                         FrRed = R(1) + TotalRed(0)
  1337.                         FrGreen = G(1) + TotalGreen(0)
  1338.                         FrBlue = B(1) + TotalBlue(0)
  1339.                         If GetPixel(hdc, Fore.X, Fore.Y) = .ForeColor Then
  1340.                             'If GetPixel(hdc, Fore.X, Fore.Y) <> .ForeColor Then'>> For Show Len(Caption) Fill
  1341.                             SetPixel .hdc, Fore.X, Fore.Y, RGB(FrRed, FrGreen, FrBlue)
  1342.                             R(1) = R(1) + TotalRed(1)
  1343.                             G(1) = G(1) + TotalGreen(1)
  1344.                             B(1) = B(1) + TotalBlue(1)
  1345.                         End If
  1346.                     Next Fore.Y
  1347.                 Next Fore.X
  1348.             Case Is = VerticalFill
  1349.                 If MouseDown Then
  1350.                     ConvertRGB mForeColor, R(0), G(0), B(0)
  1351.                     ConvertRGB mForeColorPressed, R(1), G(1), B(1)
  1352.                 ElseIf MouseMove Then
  1353.                     ConvertRGB mForeColor, R(0), G(0), B(0)
  1354.                     ConvertRGB mForeColorHover, R(1), G(1), B(1)
  1355.                 Else
  1356.                     ConvertRGB mForeColor, R(0), G(0), B(0)
  1357.                     ConvertRGB mForeColorPressed, R(1), G(1), B(1)
  1358.                 End If
  1359.                 For Fore.X = CaptionPos(0).X To CaptionPos(0).X + CaptionPos(1).X
  1360.                     For Fore.Y = CaptionPos(0).Y To CaptionPos(0).Y + CaptionPos(1).Y
  1361.                         TotalRed(0) = (R(0) - R(1)) / .ScaleHeight * Fore.Y
  1362.                         TotalGreen(0) = (G(0) - G(1)) / .ScaleHeight * Fore.Y
  1363.                         TotalBlue(0) = (B(0) - B(1)) / .ScaleHeight * Fore.Y
  1364.                         FrRed = R(1) + TotalRed(0)
  1365.                         FrGreen = G(1) + TotalGreen(0)
  1366.                         FrBlue = B(1) + TotalBlue(0)
  1367.                         If GetPixel(hdc, Fore.X, Fore.Y) = .ForeColor Then
  1368.                             SetPixel .hdc, Fore.X, Fore.Y, RGB(FrRed, FrGreen, FrBlue)
  1369.                             R(1) = R(1) + TotalRed(1)
  1370.                             G(1) = G(1) + TotalGreen(1)
  1371.                             B(1) = B(1) + TotalBlue(1)
  1372.                         End If
  1373.                     Next Fore.Y
  1374.                 Next Fore.X
  1375.         End Select
  1376.         .MaskColor = .BackColor                            '>> Change ButtonStyleColor From Opaque To Transparent
  1377.         '............................................................
  1378.         '>> Change BorderColor When Mouse Hovered Or Pressed Or Off
  1379.         '............................................................
  1380.         If MouseDown Then
  1381.             .ForeColor = mBorderColorPressed
  1382.         ElseIf MouseMove Then
  1383.             .ForeColor = mBorderColorHover
  1384.         Else
  1385.             .ForeColor = mBorderColor
  1386.         End If
  1387.         '............................................................
  1388.         '>> Calling ButtonShape's
  1389.         '............................................................
  1390.         Select Case mButtonShape
  1391.             Case Is = Rectangle: Redraw_Rectangle
  1392.             Case Is = RoundedRectangle: Redraw_RoundedRectangle
  1393.             Case Is = Round: Redraw_Round
  1394.             Case Is = Diamond: Redraw_Diamond
  1395.             Case Is = Top_Triangle: Redraw_Top_Triangle
  1396.             Case Is = Left_Triangle: Redraw_Left_Triangle
  1397.             Case Is = Right_Triangle: Redraw_Right_Triangle
  1398.             Case Is = Down_Triangle: Redraw_Down_Triangle
  1399.             Case Is = top_Arrow: Redraw_Top_Arrow
  1400.             Case Is = Left_Arrow: Redraw_Left_Arrow
  1401.             Case Is = Right_Arrow: Redraw_Right_Arrow
  1402.             Case Is = Down_Arrow: Redraw_Down_Arrow
  1403.         End Select
  1404.         '............................................................
  1405.         '>> Use GetPixel And SetPixel For Make Point's On FocusRect.
  1406.         '............................................................
  1407.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1408.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1409.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1410.                     For Fo.X = 3 To .ScaleWidth - 3 Step 2
  1411.                         For Fo.Y = 3 To .ScaleHeight - 3 Step 2
  1412.                             If GetPixel(.hdc, Fo.X, Fo.Y) = .ForeColor Then SetPixel .hdc, Fo.X, Fo.Y, vbBlack
  1413.                         Next Fo.Y: Next Fo.X
  1414.                     For Fo.X = 2 To .ScaleWidth - 2 Step 2
  1415.                         For Fo.Y = 2 To .ScaleHeight - 2 Step 2
  1416.                             If GetPixel(.hdc, Fo.X, Fo.Y) = .ForeColor Then SetPixel .hdc, Fo.X, Fo.Y, vbBlack
  1417.                         Next Fo.Y: Next Fo.X
  1418.                 End If
  1419.             End If
  1420.         End If
  1421.         '............................................................
  1422.         '>> Draw FocusRect Java About The Text.
  1423.         '............................................................
  1424.         If Len(mCaption) > 0 Then
  1425.             If mButtonStyle = Java And mFocusRect And mFocused Then
  1426.                 .ForeColor = BDR_FOCUSRECT_JAVA
  1427.                 RoundRect hdc, CaptionPos(1).X + CaptionPos(0).X + 2, CaptionPos(1).Y + CaptionPos(0).Y + 2, CaptionPos(0).X - 3, CaptionPos(0).Y - 2, 0, 0
  1428.             End If
  1429.         End If
  1430.         '............................................................
  1431.         '>> DropDown,Left DropDown,Right DropDown
  1432.         '............................................................
  1433.         Dim Flags(1)     As POINTAPI
  1434.         Select Case mDropDown
  1435.             Case Is = LeftDropDown
  1436.                 Flags(0).X = 2
  1437.                 Flags(0).Y = .ScaleHeight / 2 + Flags(0).Y / .ScaleHeight - 8
  1438.             Case Is = RightDropDown
  1439.                 Flags(0).X = .ScaleWidth - 21
  1440.                 Flags(0).Y = .ScaleHeight / 2 + Flags(0).Y / .ScaleHeight - 8
  1441.         End Select
  1442.         '............................................................
  1443.         '>> DropDown >> Left DropDown,Right DropDown
  1444.         '............................................................
  1445.         If Not mDropDown = None Then                       '>> So If mDropDown=LeftDropDown Or RightDropDown then
  1446.             .ForeColor = vbBlack                           '>> mForeColor If You Like.
  1447.             'Drwa Chevron
  1448.             MoveToEx .hdc, Flags(0).X + 6, Flags(0).Y + 5, Flags(1)
  1449.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 8
  1450.             LineTo .hdc, Flags(0).X + 13, Flags(0).Y + 4
  1451.             MoveToEx .hdc, Flags(0).X + 7, Flags(0).Y + 5, Flags(1)
  1452.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 7
  1453.             LineTo .hdc, Flags(0).X + 12, Flags(0).Y + 4
  1454.             MoveToEx .hdc, Flags(0).X + 6, Flags(0).Y + 9, Flags(1)
  1455.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 12
  1456.             LineTo .hdc, Flags(0).X + 13, Flags(0).Y + 8
  1457.             MoveToEx .hdc, Flags(0).X + 7, Flags(0).Y + 9, Flags(1)
  1458.             LineTo .hdc, Flags(0).X + 9, Flags(0).Y + 11
  1459.             LineTo .hdc, Flags(0).X + 12, Flags(0).Y + 8
  1460.         End If
  1461.         .MaskPicture = .Image                              '>> Change ButtonStyleColor From Transparent To Opaque When Add Picture.
  1462.         .Refresh                                           '>> AutoRedraw=True
  1463.     End With
  1464. End Sub
  1465. Private Sub Redraw_Rectangle()
  1466.     Dim hRgn             As Long
  1467.     With UserControl
  1468.         '>> Rectangle >> Make Rectangle Shape.
  1469.         LineTo .hdc, 0, .ScaleHeight - 1
  1470.         LineTo .hdc, .ScaleWidth - 1, .ScaleHeight - 1
  1471.         LineTo .hdc, .ScaleWidth - 1, 0
  1472.         LineTo .hdc, 0, 0
  1473.         SetWindowRgn .hWnd, hRgn, False                    '>>Retune Original Shape To Button Without Cutting
  1474.         Select Case mButtonStyle
  1475.             Case Is = Visual                               '>> Rectangle >> Draw Visual Style.
  1476.                 If MouseDown Then
  1477.                     .ForeColor = BDR_VISUAL
  1478.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1479.                     LineTo .hdc, 0, 0
  1480.                     LineTo .hdc, 0, .ScaleHeight - 1
  1481.                     .ForeColor = BDR_VISUAL1
  1482.                     MoveToEx .hdc, .ScaleWidth - 1, 1, Lines
  1483.                     LineTo .hdc, 1, 1
  1484.                     LineTo .hdc, 1, .ScaleHeight - 1
  1485.                 Else
  1486.                     .ForeColor = BDR_VISUAL1
  1487.                     MoveToEx .hdc, .ScaleWidth - 2, 0, Lines
  1488.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1489.                     LineTo .hdc, 0, .ScaleHeight - 2
  1490.                     .ForeColor = BDR_VISUAL2
  1491.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1492.                     LineTo .hdc, 0, 0
  1493.                     LineTo .hdc, 0, .ScaleHeight - 1
  1494.                 End If
  1495.             Case Is = Flat                                 '>> Rectangle >> Draw Flat Style.
  1496.                 If MouseDown Then
  1497.                     .ForeColor = BDR_FLAT1
  1498.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1499.                     LineTo .hdc, 0, 0
  1500.                     LineTo .hdc, 0, .ScaleHeight - 1
  1501.                 Else
  1502.                     .ForeColor = BDR_FLAT2
  1503.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1504.                     LineTo .hdc, 0, 0
  1505.                     LineTo .hdc, 0, .ScaleHeight - 1
  1506.                 End If
  1507.             Case Is = OverFlat                             '>> Rectangle >> Draw OverFlat Style.
  1508.                 If MouseDown Then
  1509.                     .ForeColor = BDR_FLAT1
  1510.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1511.                     LineTo .hdc, 0, 0
  1512.                     LineTo .hdc, 0, .ScaleHeight - 1
  1513.                 ElseIf MouseMove Then
  1514.                     .ForeColor = BDR_FLAT2
  1515.                     MoveToEx .hdc, .ScaleWidth - 1, 0, Lines
  1516.                     LineTo .hdc, 0, 0
  1517.                     LineTo .hdc, 0, .ScaleHeight - 1
  1518.                 End If
  1519.             Case Is = Java                                 '>> Rectangle >> Draw Java Style.
  1520.                 If .Enabled Then
  1521.                     .ForeColor = BDR_JAVA1
  1522.                     MoveToEx .hdc, .ScaleWidth - 2, 1, Lines
  1523.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1524.                     LineTo .hdc, 2, .ScaleHeight - 2
  1525.                     .ForeColor = BDR_JAVA2
  1526.                     MoveToEx .hdc, .ScaleWidth - 1, 1, Lines
  1527.                     LineTo .hdc, 1, 1
  1528.                     LineTo .hdc, 1, .ScaleHeight - 1
  1529.                     LineTo .hdc, .ScaleWidth - 1, .ScaleHeight - 1
  1530.                     LineTo .hdc, .ScaleWidth - 1, 1
  1531.                 End If
  1532.             Case Is = WinXp                                '>> Rectangle >> Draw WindowsXp Style
  1533.                 If MouseDown Then
  1534.                     .ForeColor = BDR_PRESSED
  1535.                     MoveToEx .hdc, 2, .ScaleHeight - 3, Lines
  1536.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 3
  1537.                     LineTo .hdc, .ScaleWidth - 3, 2
  1538.                 ElseIf MouseMove Then
  1539.                     .ForeColor = BDR_GOLDXP_DARK
  1540.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight - 2, Lines
  1541.                     LineTo .hdc, 0, .ScaleHeight - 2
  1542.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1543.                     MoveToEx .hdc, 1, 1, Lines
  1544.                     LineTo .hdc, 1, .ScaleHeight - 3
  1545.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 3
  1546.                     LineTo .hdc, .ScaleWidth - 2, 1
  1547.                     .ForeColor = BDR_GOLDXP_NORMAL2
  1548.                     MoveToEx .hdc, 2, 2, Lines
  1549.                     LineTo .hdc, 2, .ScaleHeight - 3
  1550.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight - 4, Lines
  1551.                     LineTo .hdc, .ScaleWidth - 3, 2
  1552.                     .ForeColor = BDR_GOLDXP_LIGHT1
  1553.                     MoveToEx .hdc, 1, 1, Lines
  1554.                     LineTo .hdc, .ScaleWidth - 1, 1
  1555.                     .ForeColor = BDR_GOLDXP_LIGHT2
  1556.                     MoveToEx .hdc, 2, 2, Lines
  1557.                     LineTo .hdc, .ScaleWidth - 2, 2
  1558.                     '>> Rectangle >> Draw Xp FocusRect.
  1559.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  1560.                     .ForeColor = BDR_BLUEXP_DARK
  1561.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight - 2, Lines
  1562.                     LineTo .hdc, 0, .ScaleHeight - 2
  1563.                     .ForeColor = BDR_BLUEXP_NORMAL1
  1564.                     MoveToEx .hdc, 1, 1, Lines
  1565.                     LineTo .hdc, 1, .ScaleHeight - 3
  1566.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 3
  1567.                     LineTo .hdc, .ScaleWidth - 2, 1
  1568.                     .ForeColor = BDR_BLUEXP_NORMAL2
  1569.                     MoveToEx .hdc, 2, 2, Lines
  1570.                     LineTo .hdc, 2, .ScaleHeight - 3
  1571.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight - 4, Lines
  1572.                     LineTo .hdc, .ScaleWidth - 3, 2
  1573.                     .ForeColor = BDR_BLUEXP_LIGHT1
  1574.                     MoveToEx .hdc, 1, 1, Lines
  1575.                     LineTo .hdc, .ScaleWidth - 1, 1
  1576.                     .ForeColor = BDR_BLUEXP_LIGHT2
  1577.                     MoveToEx .hdc, 2, 2, Lines
  1578.                     LineTo .hdc, .ScaleWidth - 2, 2
  1579.                 End If
  1580.             Case Is = Vista    '>> Rectangle >> Draw Vista Style.
  1581.                 If MouseDown Then
  1582.                     .ForeColor = BDR_VISTA2
  1583.                     MoveToEx .hdc, 1, 1, Lines
  1584.                     LineTo .hdc, 1, .ScaleHeight - 2
  1585.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1586.                     LineTo .hdc, .ScaleWidth - 2, 1
  1587.                     LineTo .hdc, 1, 1
  1588.                 Else
  1589.                     .ForeColor = BDR_VISTA1
  1590.                     MoveToEx .hdc, 1, 1, Lines
  1591.                     LineTo .hdc, 1, .ScaleHeight - 2
  1592.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1593.                     LineTo .hdc, .ScaleWidth - 2, 1
  1594.                     LineTo .hdc, 1, 1
  1595.                     '>> Rectangle >> Draw Vista FocusRect.
  1596.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  1597.                         .ForeColor = BDR_FOCUSRECT_VISTA
  1598.                         MoveToEx .hdc, 1, 1, Lines
  1599.                         LineTo .hdc, 1, .ScaleHeight - 2
  1600.                         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 2
  1601.                         LineTo .hdc, .ScaleWidth - 2, 1
  1602.                         LineTo .hdc, 1, 1
  1603.                     End If
  1604.                 End If
  1605.         End Select
  1606.         '>> Rectangle >> Draw FocusRect.
  1607.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1608.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1609.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1610.                     .ForeColor = BDR_FOCUSRECT
  1611.                     MoveToEx .hdc, 4, 4, Lines
  1612.                     LineTo .hdc, 4, .ScaleHeight - 5
  1613.                     LineTo .hdc, .ScaleWidth - 5, .ScaleHeight - 5
  1614.                     LineTo .hdc, .ScaleWidth - 5, 4
  1615.                     LineTo .hdc, 4, 4
  1616.                 End If
  1617.             End If
  1618.         End If
  1619.     End With
  1620. End Sub
  1621. Private Sub Redraw_RoundedRectangle()
  1622.     With UserControl
  1623.         '>> RoundedRectangle >> Make RoundedRectangle Shape.
  1624.         hRgn = CreateRoundRectRgn(0, 0, .ScaleWidth, .ScaleHeight, 15, 15)
  1625.         SetWindowRgn .hWnd, hRgn, True
  1626.         DeleteObject hRgn
  1627.  
  1628.         '>> RoundedRectangle >> Draw RoundedRectangle Shape.
  1629.         RoundRect hdc, 0, 0, .ScaleWidth - 1, .ScaleHeight - 1, 16, 16
  1630.  
  1631.         Select Case mButtonStyle
  1632.             Case Is = Visual                               '>> RoundedRectangle >> Draw Visual Style.
  1633.                 If MouseDown Then
  1634.                     .ForeColor = BDR_VISUAL
  1635.                     MoveToEx .hdc, 10, 0, Lines
  1636.                     LineTo .hdc, .ScaleWidth - 8, 0
  1637.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1638.                     MoveToEx .hdc, 0, 10, Lines
  1639.                     LineTo .hdc, 0, .ScaleHeight - 10
  1640.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight
  1641.                     Arc .hdc, 16, .ScaleHeight - 16, 0, .ScaleHeight - 2, -16, .ScaleHeight - 16, 8, .ScaleHeight
  1642.                     .ForeColor = BDR_VISUAL1
  1643.                     MoveToEx .hdc, 10, 1, Lines
  1644.                     LineTo .hdc, .ScaleWidth - 8, 1
  1645.                     Arc .hdc, 17, 17, 1, 1, 10, 1, 1, 10
  1646.                     MoveToEx .hdc, 1, 10, Lines
  1647.                     LineTo .hdc, 1, .ScaleHeight - 10
  1648.                     Arc .hdc, 17, .ScaleHeight - 16, 1, .ScaleHeight - 2, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1649.                 Else
  1650.                     .ForeColor = BDR_VISUAL1
  1651.                     RoundRect hdc, 0, 0, .ScaleWidth - 2, .ScaleHeight - 2, 15, 15
  1652.                     .ForeColor = BDR_VISUAL2
  1653.                     MoveToEx .hdc, 10, 0, Lines
  1654.                     LineTo .hdc, .ScaleWidth - 8, 0
  1655.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1656.                     MoveToEx .hdc, 0, 10, Lines
  1657.                     LineTo .hdc, 0, .ScaleHeight - 10
  1658.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 2, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1659.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1660.                 End If
  1661.             Case Is = Flat                                 '>> RoundedRectangle >> Draw Flat Style.
  1662.                 If MouseDown Then
  1663.                     .ForeColor = BDR_FLAT1
  1664.                     MoveToEx .hdc, 10, 0, Lines
  1665.                     LineTo .hdc, .ScaleWidth - 8, 0
  1666.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1667.                     MoveToEx .hdc, 0, 10, Lines
  1668.                     LineTo .hdc, 0, .ScaleHeight - 10
  1669.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1670.                 Else
  1671.                     .ForeColor = BDR_FLAT2
  1672.                     MoveToEx .hdc, 10, 0, Lines
  1673.                     LineTo .hdc, .ScaleWidth - 8, 0
  1674.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1675.                     MoveToEx .hdc, 0, 10, Lines
  1676.                     LineTo .hdc, 0, .ScaleHeight - 10
  1677.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1678.                 End If
  1679.             Case Is = OverFlat                             '>> RoundedRectangle >> Draw OverFlat Style.
  1680.                 If MouseDown Then
  1681.                     .ForeColor = BDR_FLAT1
  1682.                     MoveToEx .hdc, 10, 0, Lines
  1683.                     LineTo .hdc, .ScaleWidth - 8, 0
  1684.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1685.                     MoveToEx .hdc, 0, 10, Lines
  1686.                     LineTo .hdc, 0, .ScaleHeight - 10
  1687.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1688.                 ElseIf MouseMove Then
  1689.                     .ForeColor = BDR_FLAT2
  1690.                     MoveToEx .hdc, 10, 0, Lines
  1691.                     LineTo .hdc, .ScaleWidth - 8, 0
  1692.                     Arc .hdc, 17, 17, 0, 0, 10, 0, 0, 10
  1693.                     MoveToEx .hdc, 0, 10, Lines
  1694.                     LineTo .hdc, 0, .ScaleHeight - 10
  1695.                     Arc .hdc, 17, .ScaleHeight - 17, 0, .ScaleHeight - 1, -16, .ScaleHeight - 16, 9, .ScaleHeight - 1
  1696.                 End If
  1697.             Case Is = Java                                 '>> RoundedRectangle >> Draw Java Style.
  1698.                 If .Enabled Then
  1699.                     .ForeColor = BDR_JAVA1
  1700.                     RoundRect hdc, 0, 0, .ScaleWidth - 2, .ScaleHeight - 2, 16, 16
  1701.                     .ForeColor = BDR_JAVA2
  1702.                     RoundRect hdc, 1, 1, .ScaleWidth - 1, .ScaleHeight - 1, 16, 16
  1703.                 End If
  1704.             Case Is = WinXp                                '>> RoundedRectangle >> Draw WindowsXp Style.
  1705.                 If MouseDown Then
  1706.                     .ForeColor = BDR_PRESSED
  1707.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 10, .ScaleHeight - 3, .ScaleWidth - 2, .ScaleHeight - 10
  1708.                     MoveToEx .hdc, .ScaleWidth - 9, .ScaleHeight - 4, Lines
  1709.                     LineTo .hdc, 8, .ScaleHeight - 4
  1710.                     MoveToEx .hdc, .ScaleWidth - 4, 4, Lines
  1711.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight - 9
  1712.                 ElseIf MouseMove Then
  1713.                     .ForeColor = BDR_GOLDXP_DARK
  1714.                     Arc .hdc, 16, .ScaleHeight - 17, 1, .ScaleHeight - 2, -17, .ScaleHeight, 8, .ScaleHeight - 1
  1715.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 3, Lines
  1716.                     LineTo .hdc, 8, .ScaleHeight - 3
  1717.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 2, .ScaleHeight - 2, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1718.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1719.                     Arc .hdc, 17, .ScaleHeight - 18, 1, .ScaleHeight - 3, -18, .ScaleHeight, 10, .ScaleHeight - 1
  1720.                     MoveToEx .hdc, 1, 6, Lines
  1721.                     LineTo .hdc, 1, .ScaleHeight - 8
  1722.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 4, Lines
  1723.                     LineTo .hdc, 8, .ScaleHeight - 4
  1724.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1725.                     MoveToEx .hdc, .ScaleWidth - 3, 6, Lines
  1726.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 8
  1727.                     .ForeColor = BDR_GOLDXP_NORMAL2
  1728.                     MoveToEx .hdc, 2, 7, Lines
  1729.                     LineTo .hdc, 2, .ScaleHeight - 7
  1730.                     MoveToEx .hdc, .ScaleWidth - 4, 7, Lines
  1731.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight - 7
  1732.                     Arc .hdc, 17, 17, 1, 1, 8, 0, 0, 8
  1733.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 2, 1, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1734.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 3, 2, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1735.                     Arc .hdc, 17, 17, 2, 2, 8, 0, 0, 8
  1736.                     .ForeColor = BDR_GOLDXP_LIGHT1
  1737.                     MoveToEx .hdc, 10, 1, Lines
  1738.                     LineTo .hdc, .ScaleWidth - 7, 1
  1739.                     .ForeColor = BDR_GOLDXP_LIGHT2
  1740.                     MoveToEx .hdc, 10, 2, Lines
  1741.                     LineTo .hdc, .ScaleWidth - 8, 2
  1742.                     '>> RoundedRectangle >> Draw Xp FocusRect.
  1743.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  1744.                     .ForeColor = BDR_BLUEXP_DARK
  1745.                     Arc .hdc, 16, .ScaleHeight - 17, 1, .ScaleHeight - 2, -17, .ScaleHeight, 8, .ScaleHeight - 1
  1746.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 3, Lines
  1747.                     LineTo .hdc, 8, .ScaleHeight - 3
  1748.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 2, .ScaleHeight - 2, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1749.                     .ForeColor = BDR_BLUEXP_NORMAL1
  1750.                     Arc .hdc, 17, .ScaleHeight - 18, 1, .ScaleHeight - 3, -18, .ScaleHeight, 10, .ScaleHeight
  1751.                     MoveToEx .hdc, 1, 6, Lines
  1752.                     LineTo .hdc, 1, .ScaleHeight - 8
  1753.                     MoveToEx .hdc, .ScaleWidth - 8, .ScaleHeight - 4, Lines
  1754.                     LineTo .hdc, 8, .ScaleHeight - 4
  1755.                     Arc .hdc, .ScaleWidth - 17, .ScaleHeight - 17, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 10, .ScaleHeight - 2, .ScaleWidth - 1, .ScaleHeight - 10
  1756.                     MoveToEx .hdc, .ScaleWidth - 3, 6, Lines
  1757.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 8
  1758.                     .ForeColor = BDR_BLUEXP_NORMAL2
  1759.                     MoveToEx .hdc, 2, 7, Lines
  1760.                     LineTo .hdc, 2, .ScaleHeight - 7
  1761.                     MoveToEx .hdc, .ScaleWidth - 4, 7, Lines
  1762.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight - 7
  1763.                     Arc .hdc, 17, 17, 1, 1, 8, 0, 0, 8
  1764.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 2, 1, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1765.                     Arc .hdc, .ScaleWidth - 17, 17, .ScaleWidth - 3, 2, .ScaleWidth - 1, 8, .ScaleWidth - 12, 1
  1766.                     Arc .hdc, 17, 17, 2, 2, 8, 0, 0, 8
  1767.                     .ForeColor = BDR_BLUEXP_LIGHT1
  1768.                     MoveToEx .hdc, 10, 1, Lines
  1769.                     LineTo .hdc, .ScaleWidth - 7, 1
  1770.                     .ForeColor = BDR_BLUEXP_LIGHT2
  1771.                     MoveToEx .hdc, 10, 2, Lines
  1772.                     LineTo .hdc, .ScaleWidth - 8, 2
  1773.                 End If
  1774.             Case Is = Vista    '>> RoundedRectangle >> Draw Vista Style.
  1775.                 If MouseDown Then
  1776.                     .ForeColor = BDR_VISTA2
  1777.                     RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, 14, 14
  1778.                 Else
  1779.                     .ForeColor = BDR_VISTA1
  1780.                     RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, 14, 14
  1781.                     '>> RoundedRectangle >> Draw Vista FocusRect.
  1782.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  1783.                         .ForeColor = BDR_FOCUSRECT_VISTA
  1784.                         RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, 14, 14
  1785.                     End If
  1786.                 End If
  1787.         End Select
  1788.         '>> RoundedRectangle >> Draw FocusRect.
  1789.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1790.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1791.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1792.                     .ForeColor = BDR_FOCUSRECT
  1793.                     RoundRect .hdc, 4, 4, .ScaleWidth - 5, .ScaleHeight - 5, 15, 15
  1794.                 End If
  1795.             End If
  1796.         End If
  1797.     End With
  1798. End Sub
  1799. Private Sub Redraw_Round()
  1800.     With UserControl
  1801.         '>> Round >> Make Round Shape.
  1802.         'hRgn = CreateRoundRectRgn(0, 0, .ScaleWidth, .ScaleHeight, .ScaleWidth , .ScaleHeight )
  1803.         hRgn = CreateEllipticRgn(0, 0, .ScaleWidth, .ScaleHeight)
  1804.         SetWindowRgn .hWnd, hRgn, True
  1805.         DeleteObject hRgn
  1806.  
  1807.         '>> Round >> Draw Round Shape.
  1808.         RoundRect hdc, 1, 1, .ScaleWidth - 2, .ScaleHeight - 2, .ScaleWidth - 2, .ScaleHeight - 2
  1809.  
  1810.         Select Case mButtonStyle
  1811.             Case Is = Visual                               '>> Round >> Draw Visual Style.
  1812.                 If MouseDown Then
  1813.                     .ForeColor = BDR_VISUAL
  1814.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1815.                     .ForeColor = BDR_VISUAL1
  1816.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 2, 2, .ScaleWidth - 3, 2, 2, .ScaleHeight - 3
  1817.                 Else
  1818.                     .ForeColor = BDR_VISUAL1
  1819.                     Arc .hdc, 1, 1, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth / 3, .ScaleHeight / 2, .ScaleWidth - 3, 1
  1820.                     .ForeColor = BDR_VISUAL2
  1821.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1822.                 End If
  1823.             Case Is = Flat                                 '>> Round >> Draw Flat Style.
  1824.                 If MouseDown Then
  1825.                     .ForeColor = BDR_FLAT1
  1826.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1827.                 Else
  1828.                     .ForeColor = BDR_FLAT2
  1829.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1830.                 End If
  1831.             Case Is = OverFlat                             '>> Round >> Draw OverFlat Style.
  1832.                 If MouseDown Then
  1833.                     .ForeColor = BDR_FLAT1
  1834.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1835.                 ElseIf MouseMove Then
  1836.                     .ForeColor = BDR_FLAT2
  1837.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 2
  1838.                 End If
  1839.             Case Is = Java                                 '>> Round >> Draw Java Style.
  1840.                 If .Enabled Then
  1841.                     .ForeColor = BDR_JAVA1
  1842.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 2, 2, .ScaleWidth / 2, .ScaleHeight - 3, .ScaleWidth / 2, 3
  1843.                     .ForeColor = BDR_JAVA2
  1844.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 2, 2, .ScaleWidth / 2, 2, .ScaleWidth / 2, .ScaleHeight - 2
  1845.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 2
  1846.                 End If
  1847.             Case Is = WinXp                                '>> Round >> Draw WindowsXp Style.
  1848.                 If MouseDown Then
  1849.                     .ForeColor = BDR_PRESSED
  1850.                     Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 3
  1851.                 ElseIf MouseMove Then
  1852.                     .ForeColor = BDR_GOLDXP_DARK
  1853.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, 2, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1854.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1855.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 4, 3, 3, .ScaleWidth - 2, 4
  1856.                     .ForeColor = BDR_GOLDXP_NORMAL2
  1857.                     Arc .hdc, 3, 3, .ScaleWidth - 4, .ScaleHeight - 3, 2, 3, .ScaleWidth - 2, 3
  1858.                     .ForeColor = BDR_GOLDXP_LIGHT1
  1859.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 2, 2, 2, .ScaleWidth - 3, 3, 3, 3
  1860.                     .ForeColor = BDR_GOLDXP_LIGHT2
  1861.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 3, 3, .ScaleWidth - 3, 4, 4, 4
  1862.                     '>> Round >> Draw Xp FocusRect.
  1863.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  1864.                     .ForeColor = BDR_BLUEXP_DARK
  1865.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, 2, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1866.                     .ForeColor = BDR_BLUEXP_NORMAL1
  1867.                     Arc .hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 4, 3, 3, .ScaleWidth - 2, 4
  1868.                     .ForeColor = BDR_BLUEXP_NORMAL2
  1869.                     Arc .hdc, 3, 3, .ScaleWidth - 4, .ScaleHeight - 3, 2, 3, .ScaleWidth - 2, 3
  1870.                     .ForeColor = BDR_BLUEXP_LIGHT1
  1871.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 2, 2, 2, .ScaleWidth - 3, 3, 3, 3
  1872.                     .ForeColor = BDR_BLUEXP_LIGHT2
  1873.                     Arc .hdc, .ScaleWidth - 3, .ScaleHeight - 3, 3, 3, .ScaleWidth - 3, 4, 4, 4
  1874.                 End If
  1875.             Case Is = Vista    '>> Round >> Draw Vista Style.
  1876.                 If MouseDown Then
  1877.                     .ForeColor = BDR_VISTA2
  1878.                     RoundRect hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1879.                 Else
  1880.                     .ForeColor = BDR_VISTA1
  1881.                     RoundRect hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1882.                     '>> Round >> Draw Vista FocusRect.
  1883.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  1884.                         .ForeColor = BDR_FOCUSRECT_VISTA
  1885.                         RoundRect hdc, 2, 2, .ScaleWidth - 3, .ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  1886.                     End If
  1887.                 End If
  1888.         End Select
  1889.         '>> Round >> Draw FocusRect.
  1890.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  1891.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  1892.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  1893.                     .ForeColor = BDR_FOCUSRECT
  1894.                     RoundRect hdc, 4, 4, .ScaleWidth - 5, .ScaleHeight - 5, .ScaleWidth - 5, .ScaleHeight - 5
  1895.                 End If
  1896.             End If
  1897.         End If
  1898.     End With
  1899. End Sub
  1900. Private Sub Redraw_Diamond()
  1901.     With UserControl
  1902.         '>> Diamond >> Make Diamond Shape.
  1903.         P(0).X = .ScaleWidth: P(0).Y = .ScaleHeight / 2
  1904.         P(1).X = .ScaleWidth / 2: P(1).Y = 0
  1905.         P(2).X = 0: P(2).Y = .ScaleHeight / 2
  1906.         P(3).X = .ScaleWidth / 2: P(3).Y = .ScaleHeight
  1907.         hRgn = CreatePolygonRgn(P(0), &H4, WINDING)
  1908.         SetWindowRgn .hWnd, hRgn, True
  1909.         DeleteObject hRgn
  1910.  
  1911.         '>> Diamond >> Draw Diamond Shape.
  1912.         MoveToEx .hdc, 0, .ScaleHeight / 2, Lines
  1913.         LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1914.         LineTo .hdc, .ScaleWidth - 1, .ScaleHeight / 2
  1915.         LineTo .hdc, .ScaleWidth / 2, 0
  1916.         LineTo .hdc, 0, .ScaleHeight / 2
  1917.         If Not mButtonStyleColors = Transparent Then
  1918.             MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1919.             LineTo .hdc, .ScaleWidth / 2, 0
  1920.         End If
  1921.         Select Case mButtonStyle
  1922.             Case Is = Visual                               '>> Diamond >> Draw Visual Style.
  1923.                 If MouseDown Then
  1924.                     .ForeColor = BDR_VISUAL
  1925.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1926.                     LineTo .hdc, 0, .ScaleHeight / 2
  1927.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1928.                     .ForeColor = BDR_VISUAL1
  1929.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1930.                     LineTo .hdc, 1, .ScaleHeight / 2
  1931.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1932.                 Else
  1933.                     .ForeColor = BDR_VISUAL1
  1934.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Lines
  1935.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  1936.                     LineTo .hdc, .ScaleWidth / 2, 1
  1937.                     .ForeColor = BDR_VISUAL2
  1938.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1939.                     LineTo .hdc, 0, .ScaleHeight / 2
  1940.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1941.                 End If
  1942.             Case Is = Flat                                 '>> Diamond >> Draw Flat Style.
  1943.                 If MouseDown Then
  1944.                     .ForeColor = BDR_FLAT1
  1945.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1946.                     LineTo .hdc, 0, .ScaleHeight / 2
  1947.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1948.                 Else
  1949.                     .ForeColor = BDR_FLAT2
  1950.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1951.                     LineTo .hdc, 0, .ScaleHeight / 2
  1952.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1953.                 End If
  1954.             Case Is = OverFlat                             '>> Diamond >> Draw OverFlat Style.
  1955.                 If MouseDown Then
  1956.                     .ForeColor = BDR_FLAT1
  1957.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1958.                     LineTo .hdc, 0, .ScaleHeight / 2
  1959.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1960.                 ElseIf MouseMove Then
  1961.                     .ForeColor = BDR_FLAT2
  1962.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1963.                     LineTo .hdc, 0, .ScaleHeight / 2
  1964.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1965.                 End If
  1966.             Case Is = Java                                 '>> Diamond >> Draw Java Style.
  1967.                 If .Enabled Then
  1968.                     .ForeColor = BDR_JAVA1
  1969.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1970.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  1971.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1972.                     .ForeColor = BDR_JAVA2
  1973.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  1974.                     LineTo .hdc, 1, .ScaleHeight / 2
  1975.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1976.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  1977.                     LineTo .hdc, .ScaleWidth - 1, .ScaleHeight / 2
  1978.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1979.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  1980.                 End If
  1981.             Case Is = WinXp                                '>> Diamond >> Draw WindowsXp Style.
  1982.                 If MouseDown Then
  1983.                     .ForeColor = BDR_PRESSED
  1984.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 4, Lines
  1985.                     LineTo .hdc, .ScaleWidth - 4, .ScaleHeight / 2
  1986.                     LineTo .hdc, .ScaleWidth / 2, 3
  1987.                     SetPixel .hdc, .ScaleWidth / 2, 1, vbBlack
  1988.                 ElseIf MouseMove Then
  1989.                     .ForeColor = BDR_GOLDXP_DARK
  1990.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Lines
  1991.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  1992.                     .ForeColor = BDR_GOLDXP_NORMAL1
  1993.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 3, Lines
  1994.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight / 2
  1995.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  1996.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  1997.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight / 2, Lines
  1998.                     LineTo .hdc, .ScaleWidth / 2, 1
  1999.                     .ForeColor = BDR_GOLDXP_NORMAL2
  2000.                     MoveToEx .hdc, 2, .ScaleHeight / 2, Lines
  2001.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 3
  2002.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight / 2, Lines
  2003.                     LineTo .hdc, .ScaleWidth / 2, 2
  2004.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2005.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2006.                     LineTo .hdc, 1, .ScaleHeight / 2
  2007.                     .ForeColor = BDR_GOLDXP_LIGHT2
  2008.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2009.                     LineTo .hdc, 2, .ScaleHeight / 2
  2010.                     SetPixel .hdc, .ScaleWidth / 2, 1, vbBlack
  2011.                     '>> Diamond >> Draw Xp FocusRect.
  2012.                 ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  2013.                     .ForeColor = BDR_BLUEXP_DARK
  2014.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Lines
  2015.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2016.                     .ForeColor = BDR_BLUEXP_NORMAL1
  2017.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 3, Lines
  2018.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight / 2
  2019.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2020.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2021.                     MoveToEx .hdc, .ScaleWidth - 2, .ScaleHeight / 2, Lines
  2022.                     LineTo .hdc, .ScaleWidth / 2, 1
  2023.                     .ForeColor = BDR_BLUEXP_NORMAL2
  2024.                     MoveToEx .hdc, 2, .ScaleHeight / 2, Lines
  2025.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 3
  2026.                     MoveToEx .hdc, .ScaleWidth - 3, .ScaleHeight / 2, Lines
  2027.                     LineTo .hdc, .ScaleWidth / 2, 2
  2028.                     .ForeColor = BDR_BLUEXP_LIGHT1
  2029.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2030.                     LineTo .hdc, 1, .ScaleHeight / 2
  2031.                     .ForeColor = BDR_BLUEXP_LIGHT2
  2032.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2033.                     LineTo .hdc, 2, .ScaleHeight / 2
  2034.                     SetPixel .hdc, .ScaleWidth / 2, 1, vbBlack
  2035.                 End If
  2036.             Case Is = Vista    '>> Diamond >> Draw Vista Style.
  2037.                 If MouseDown Then
  2038.                     .ForeColor = BDR_VISTA2
  2039.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2040.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2041.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2042.                     LineTo .hdc, .ScaleWidth / 2, 1
  2043.                     LineTo .hdc, 1, .ScaleHeight / 2
  2044.                 Else
  2045.                     .ForeColor = BDR_VISTA1
  2046.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2047.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2048.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2049.                     LineTo .hdc, .ScaleWidth / 2, 1
  2050.                     LineTo .hdc, 1, .ScaleHeight / 2
  2051.                     '>> Diamond >> Draw Vista FocusRect.
  2052.                     If mButtonStyle = Vista And mFocusRect And mFocused Then
  2053.                         .ForeColor = BDR_FOCUSRECT_VISTA
  2054.                         MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2055.                         LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2
  2056.                         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2057.                         LineTo .hdc, .ScaleWidth / 2, 1
  2058.                         LineTo .hdc, 1, .ScaleHeight / 2
  2059.                     End If
  2060.                 End If
  2061.         End Select
  2062.         '>> Diamond >> Draw FocusRect.
  2063.         If Not mButtonStyle = Java And mFocusRect And mFocused Then
  2064.             If Not mButtonStyle = WinXp And mFocusRect And mFocused Then
  2065.                 If Not mButtonStyle = Vista And mFocusRect And mFocused Then
  2066.                     .ForeColor = BDR_FOCUSRECT
  2067.                     PL(0).X = .ScaleWidth - 6: PL(0).Y = .ScaleHeight / 2
  2068.                     PL(1).X = .ScaleWidth / 2: PL(1).Y = 5
  2069.                     PL(2).X = 5: PL(2).Y = .ScaleHeight / 2
  2070.                     PL(3).X = .ScaleWidth / 2: PL(3).Y = .ScaleHeight - 6
  2071.                     Polygon .hdc, PL(0), &H4
  2072.                     '>> Return FocusRect For Good Show.
  2073.                     For Fo.X = 2 To .ScaleWidth - 2 Step 1
  2074.                         For Fo.Y = 1 To .ScaleHeight - 1 Step 2
  2075.                             If GetPixel(.hdc, Fo.X, Fo.Y) = .ForeColor Then SetPixel .hdc, Fo.X, Fo.Y, vbBlack
  2076.                         Next Fo.Y
  2077.                     Next Fo.X
  2078.                 End If
  2079.             End If
  2080.         End If
  2081.     End With
  2082. End Sub
  2083. Private Sub Redraw_Top_Triangle()
  2084.     With UserControl
  2085.         '>> Top_Triangle >> Make Top_Triangle Shape.
  2086.         P(0).X = 0: P(0).Y = .ScaleHeight
  2087.         P(1).X = .ScaleWidth / 2: P(1).Y = 0
  2088.         P(2).X = .ScaleWidth: P(2).Y = .ScaleHeight
  2089.         hRgn = CreatePolygonRgn(P(0), &H3, WINDING)
  2090.         SetWindowRgn .hWnd, hRgn, True
  2091.         DeleteObject hRgn
  2092.  
  2093.         '>> Top_Triangle >> Draw Top_Triangle Shape.
  2094.         MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2095.         LineTo .hdc, 1, .ScaleHeight - 1
  2096.         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 1
  2097.         LineTo .hdc, .ScaleWidth / 2, 1
  2098.  
  2099.         Select Case mButtonStyle
  2100.             Case Is = Visual                               '>> Top_Triangle >> Draw Visual Style.
  2101.                 If MouseDown Then
  2102.                     .ForeColor = BDR_VISUAL
  2103.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2104.                     LineTo .hdc, 1, .ScaleHeight - 1
  2105.                     .ForeColor = BDR_VISUAL1
  2106.                     MoveToEx .hdc, .ScaleWidth / 2, 3, Lines
  2107.                     LineTo .hdc, 3, .ScaleHeight - 3
  2108.                 Else
  2109.                     .ForeColor = BDR_VISUAL1
  2110.                     MoveToEx .hdc, 1, .ScaleHeight - 2, Lines
  2111.                     LineTo .hdc, .ScaleWidth - 3, .ScaleHeight - 2
  2112.                     LineTo .hdc, .ScaleWidth / 2, 3
  2113.                     .ForeColor = BDR_VISUAL2
  2114.                     MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2115.                     LineTo .hdc, 1, .ScaleHeight - 1
  2116.                 End If
  2117.             Case Is = Flat                                 '>> Top_Triangle >> Draw Flat Style.
  2118.                 If MouseDown Then
  2119.                     .ForeColor = BDR_FLAT1
  2120.                     MoveToEx .hdc, .ScaleWidth / 2, eWidth / 2, 1, Lines
  2121.                     LineTo .hdc, 1, .ScaleHeight - 1
  2122.            .   LineToF                   LineTo .hdcdc, Rect And mFocused Then
  2123.                         .ForeColor = BDR_FOCUSRECT_VISTA
  2124.                         MoveToEx .hdc, 1,r  .ForeColor = BDR_FOCUSRECT_VISTA
  2125.             ForeColo         '>> Top_Triangle >> Drawu&dth / 2, .Scaleuo2
  2126.                     Lieight / 2
  2127.      SUAL2F 2cineTo .hdc, 1, .ScaleHeight - 1
  2128.           or Good Show.
  2129.                     For Fo.X = 2 To .ScaleWidth - 2 Step 1       G  or Good Show.
  2130.                     For Fo.X = 2 To .ScaleWidth - 2 Step 1       G  or Good Show.
  2131.                     For Fo.X = 2 To .ScaleWidth - 2 Step 1       G  or Good Show.
  2132.                     For Fo.X = 2 To .ScaleWidth - 2 Step 1       G  or G MoveToEx .hdc, .ScaleWidth / 2, 2, Lines
  2133.         LineTo .hdc, .ScalStep 1       G  or G MoveToEx .hdc, .ScaleWidth     2,      For Fo.X = 2 To .ScaleWidth - 2 Step 1       G  or Good Shlo         '>> TopH.ScaleHeight - 3, .ScaleWidth - 3, .ScaleHeight - 3
  2134.                     End If
  2135.                 End If
  2136.         End Select
  2137.   OForeColor = BDR_FLAT1
  2138.                     MoveToEx .hdc, .ScaleWidth / 2, eWidth / 2, 1, Lines
  2139.                     LineTo .hdc, 1, .ScaleHeight - 1
  2140.            .   LineToF                     .etep 1       G  orUSRECT_VISTA
  2141.                     angle T_VISTA
  2142.      VetP              .ForeColor = BDR_VISUAL2
  2143.                     MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  2144.                     LineTo .hdc, 0, .ScaleHeight / 2
  2145.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  2146.                 End If
  2147.           C     und >> Draw FocusRect.
  2148.         If NP / 2
  2149.          ScaleWidth / 2, 1, L            Lineidth / 2, 1, vbBla/ 2, 1, vbBla/ 2, hAeTo YScaleWidth / 2, 2, Lines
  2150.         L1
  2151.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight -D .S     L1
  2152.                     LineTo .hdc, .Sc    LineTo           MoveToEx .hdc, .ScaleWidth / 2, 0, Lines
  2153.                     LineTo .hdc, 0, .ScaleHe5, .ScaleHeigLine2, 1, vbBla/ 2, hAeTo YScaiGF .hdc, 1, .ScaleHeight - , .ScaleHeight - 3, 2/a/ 2, hAeTo  Sub Redraw_Top_TrN2, hJava              8pava            9dmM   8pava       vbBla/ 2, hAeTo YScaiGF .hdc, 1, .ScaleHeight - , .ScaleHeight - inesx 2, .ScaleWidth - 3, 3, 3, 3
  2154.                     .ForeColtyl001>> Draw FocusRect.
  2155.         If NP / 2
  2156.          S
  2157.          Sa    YcusRect.
  2158. D .S     L1
  2159.                     LineTo .hdc, 1, .ScaleHeight - 1
  2160.                 End IfeWid1p    L1
  2161.                    ooaHeig     If NP /oOoaHeig     If NP /oOoaHeig   caleHeight / 2
  2162.       2, hJava          aleHeiiangle >> Draw Vi    eeeeForeColor = BDO     aleHeiiangle  / 2, 1, o   2, 2, 1, o   2, 2, 1, o   2, 2, 1, o   2, 2, 1, F  2, hJavleHeiianglig   caleHeight / p 1   vidth - 2 Step 1  t - 1
  2163.                 End IfeWid/ 2e.
  2164.         MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2165.         LineTo .hdc, 1, .ScaleHeight - 1
  2166.      I8ed Then
  2167. 1>> Drolor                                                                                                                                   3 2, .Scaletep ht / 2   If NP /oOoaHeig   caleHeight / 2
  2168.       2, hJava          aleHeiian           MoveToEx .hdcBO          3 2, .Scaletep hteig     If NP   MoveTc, .Sw  For Fo.X = 2 To .ScaleWidth - 2 Step 1       G       2, hAeTo YScaleWidth / 2 th - 2 Step 1       G     G   4
  2169. 1>> Drolor                                                                  d                                            d                                            d                                            d                             d                                   MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2170.                     LinCHnStyle
  2171.             Ca 2, 2, , .ScaleWidth / 2, 1, Lines
  2172.         LineTo .hdc, 1,              olor = BDR_FLAT1
  2173.                     MoveToEx .hdc, .ScaleWidth / 2, eWidth / 2, 1, Lines
  2174.                     LineTo .hdc, 1, .ScaleHeight - 1
  2175.            .   LineToF                     .etep 1       )   2, 2                                  d                                            d    rOtep 1np    LineTo .hd>> D                '>> RoundedRectang          G  or Good Show.
  2176.                     For Fo.X = 2 To .ScaleWid .hdcBOow.
  2177.    MoveToE           Linaen
  2178. 1>> Drolor               .ForoE           LiYYYYYYYYYYYYYYY1       G       2, hAeToiYYYYYYYYYYY                    nXp And mLineY   AsFFFFFFFFFFFFFFF    nXp And moiYYYYYYYYYYY                    nXp And mLineY   AsFFFFFFFFFFFFFFF      nXp And moiYYYYaleWidth - 4, .ScaleHeY   em    nXp And moiYYYYaleWidth - 4, .ScalYYYYY    2, hAeToiYYYYYn     LiYYYYYYYYYYYYYYY1       G  , 1, .ScaleHeight - 1
  2179.            .   LiFht -       FYYYYn     LiYYYYYYYYYYYYYYY1       G  , 1, .ScaleHeight - 1
  2180.            .   LiFht -       FYYYYn     LiYYYYYYYYYYYYYYY1       G  , 1, .ScaleHeight - 1
  2181.            .   LiFht -       FYYYYn     LiYYYYYYYYYYYYYYY1       G  , 1, .ScaleHeight - 1
  2182.            .kveToEx .hdc, .ScaleWidth /1       LineTo .hdc, 1, .ScaleHeight - 1
  2183.         LineTo .hdc, .ScaleWidth - 2, .Scal      LineTo .hdc, 1, .ScaleHeight - 1
  2184.         LineTo .hdc, .ScaleWidth - 2, .Scal      Lical     c, 1, .ScaleHeight -     0So                         Lical     c, 1, .ScaleHeight -     0So     .   LiFht -       FYYYYn     LiYYYYYYYYYYYYYYY1       G  , 1, .ScaleHeY       G  , 1, .SC1
  2185.   ineTo .hdc, .ScaleWidth     0So     .   LiFht -                ci '>> RoundedRectang     
  2186.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2187.                     MoveToEx .hdc, .ScaleWidth / 2, 1, Lines
  2188.                  hJavleHeiianglig                         yleWidedRectang     ttonSal    _3n1If MouseDown ThYYYYY, .ScaleHeight -     0So     .   LiFTo .h-     0SoD3, .ScaleWidth - 3, .ScaleHeight - 8
  2189.                     .ForeColor = BDR_BLUEXP_NORMAL2
  2190.                     MoveToEx .hdc, 2, 7, Lines
  2191.                     LineTo .hdc, 2, .ScaleHeight - 7
  2192.                     Mov= 5: PPPPPPPP)            For Fo.X = 2 To .Scal       M             .ForeColor = BDR_VISUAL1
  2193.                     MoveToEx .hdc, .Scale
  2194.         LineTo .hdc, 1, .ScaleHeight - 1
  2195.         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 1
  2196.         LineTo .hdc,AleHeight -     0So     .      LineTo .hdc,R_BToEx .hdc, 2, 7, Lines
  2197.   T_NORMAL2
  2198.                     MoveToEx .hdc, 2, 7, Lines
  2199.     Lines
  2200.   T_NORMAL2
  2201.            T .hdc, 2, 7, Lines
  2202.     Lines
  2203.   T_NORMAL2
  2204.            T .hdc, 2, 7, Lines
  2205.     Lines
  2206.   T_NORMALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLi1
  2207.       oYYYYYYYY    iR   caleHeight / p 1    .   sn     tScalenes
  2208.   T_NORMALLLLS.arLLi1
  2209.       oYYYYop       LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 1
  2210.                 End If
  2211.     .DaleWidth / 2, .ScaleHeight - 1
  2212.  l .hUSRECT
  2213.                     RoundLreCoORMAL2
  2214.        ht - 7
  2215.                     Mov= 5: PPPPPPP   .   LLLLLLL         .hdc, .ScaleWidth / 2PPPPPPP 3   LineTo .hdcdc, Rect And mFocused Then
  2216.      Then
  2217.           .
  2218.         
  2219.                     .ForeColor = BDR_GOLDXP_LIGHT1
  2220.                     MoveToEx .hdc, .ScaleWidth / 2, 1, LYop       LineTo .hdc, .Scaaaaaaaaaaaa                        LinCHnStyle
  2221.             Ca 2, 2, , .ScaleWidth / 2, 1, Lines
  2222.         LineTo .hdc, 1,              olor = BDR_FLAT1
  2223.    .hines
  2224.   Lines
  2225.         LineTo .hdc, 1,              olor = BDR_FLAT1
  2226.    .hines
  2227.   Lines
  2228.         LineTo .hdc, 1,              m .ForeCoYYYYalecused
  2229.                     Arc .hdc, .ScaleWidth - 2, .Scale    or = BDR_FLAT1
  2230.    .hine1
  2231.         LineTo .hdc,Al      FYYYYn     LHec, 1ines
  2232.    x .hdc, .ScIEhdc, 2, 7, Lines
  2233.   T_NORMAL2
  2234. eTo .hdc, 0, .ScalOsta    '>> Round ScaleHeight - 1
  2235.  l .hUSght - 1
  2236.  l .hUSgo .hd    SUAL2F1
  2237.  l .hUSght - 1
  2238.  l .hUSgo lor = BDR_FLAT1
  2239.    .hines
  2240.   Lin2       ght - 1
  2241.  l .hUSgo lor = BDR_FLAT1
  2242.    .hines
  2243.   Lin2       ght - 1
  2244.  l .hUSgo lor = BDR_FLAT1
  2245.    .hines
  2246.   Lin2       ght - 1
  2247.  l .hUSgo lor = BDR_FLAT1
  2248.    .hines
  2249.   Lin2       ght - 1
  2250.  l .hUSgo lor = BDR_RoundLreCoORMAL2
  2251.        ht - 7
  2252.                   .hdc, .ScaleWidthreCoORMAL2
  2253.        ht - 7
  2254.                   .hdc    2, hAeTo                     yleWidedRectang     ttonSal    _3n1If MouseDown ThYYYYY, .ScaleHeight -     0So     .   Lc, .ScaDrolor   YY, .ScaleHeight -     0So     .   Lc, .ScaDrol(B    eight -     0So  AT1
  2255.    .hines
  2256.   Lin2        1
  2257.            .kveToEx .h       .ScaleWidth / 2,n
  2258.         If NP / 2
  2259.          ScaleWidth / 2, 1, L            Lineidth / 2, 1          .kveToEx .h       .ScaleWidth / 2,n
  2260.         If NP / 2
  2261.    L       ER    .ScaleWidth / 2,n
  2262.         I.ScaleWidth / 2, 2, Lines
  2263.    ol MoveToEx .hdc, 1, .Scal.
  2264. D .S  (ER    .ScaleWidth     M             .ForeColor = BDR_VIs
  2265.         LineTo .hdcDeTo .hdc, .ScaleWidth / 2, , , .ScaleWidth /s  ScaleHeight - 1
  2266. / 2
  2267.          ScaleWidth / 2, 11, LineeWidth / 2, 1, L      1DeTo .hdc, .Scale .k                 3Fines
  2268.   Lin2        1
  2269.            .kveToEx .h       .ScaleWidth / 2,n
  2270.         If NP / 2
  2271.     p       .hdc    2, hAeTo                     ylow2  FYYYYC   eDR_GOLDXP_LIGHo        PL(3).X = .ScaleWidth / 2: PL(3 For FoL2F1
  2272.  l .hUSg     1
  2273.            .kveToEx .h       .ScaleWidth / eidth / 2, 1          .kveTa         .kveTa         lth / 2, .Scale
  2274.         LineTo .hdc, 1, .ScaleHeight - 11SRECT
  2275.    GHo        PL(3).X = .S '>> DiamoTLth /=    MoveToEx .hdc, 10, 2, Lines
  2276.                PPPPPPP   .   LLLLLLL         .hdc, .ScaleWidth / 2PPPPPPP 3   LineT0eHeight -     0So 5: PPPPPPP   .   LLLLLLL          LineTo .hdcDeTo .hdc, .Scale= .S '>> DiamoFYYYYn     LHec,x&iamoFt - 7
  2277.                   .hdc    2, hAeTo                     yleWidedRectang     ttonSal    _3n1If MouseDown ThYYYY 8, 2
  2278.     AiedRec  ght -ight - 1
  2279.         LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 1
  2280.         LineTo .hdc, .ScaleWidth / 2, 1
  2281.  
  2282.         Select Case mButtonStyle
  2283.             Case Is = Visual                               '>> Top_Triangle >> Draw Visual Style.
  2284.                 xeToE           Li   
  2285.                     .ForeCy       '6      G     G   4
  2286. 1>> Drolor                                  .ForeCy           neTo .hdc, 1, .ScaleHe6                   .ForeColor = BDR_PRESSED
  2287.                     Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 3
  2288.                 ElseIf MouseMove Then
  2289.                     .ForeColor = BDR_GOLDXP_DARK5ouseMove Tei                .ForeColor = BDR_FLAT2
  2290.               (       LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 1
  2291.         LineTo .hcaleeight - 2, 1, 1, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 2
  2292.                 End If
  2293.             Case Is = WinXp                                '>> Round >> Draw WindowsXp Style.
  2294.                 If MouseDown Then
  2295.                     .ForeColor =e              , .ScaDrFi .Sc      , .ScaDrFi .Sc      , .ScaDrFi .Sc    11 .ScaDrFi .Sc     gh              For Fo.X = 2 To .ScaleWidth - 2 Step 1       G  or G (LF
  2296. End Sub
  2297. Private Sub Redraw_Diamond()
  2298.     With UserControl
  2299.         '>> Diamond >> Make Diamond Shape70dE     Windowso
  2300.             End If
  2301.         End If
  2302.     End With
  2303. End Sub
  2304. Private Sub Redraw_Top_Triangle()
  2305.     With UserCo   End IfCs0.
  2306.     nbeig    L2 .hdc, 
  2307.     Wi Lieight / 2
  2308.    n.S '>> DiamoTLth /=    r<.X = 2 To .ScaleWidth - 2 Ste   gh    e                .ForeC/ 2, .ScaleHLthh - 2, .
  2309.         P(0).X = 0: P(0).Y = .ScaleHeight
  2310.         P(1).X = .ScaleWidth / 2:   LineTo .hdc, .ScaleWidth - 2, .ScaleHeight - 1
  2311.         LineTo calScal.
  2312. D .S  (ER   right - 1
  2313.         LineTo calScal.
  2314. D .S  (ER   ri   I/ 2, .ScaleHLt   1
  2315.                          Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth    G  or G (LF
  2316. End Sub
  2317. Private Sub Redraw_Diamond()ght - 4, 3, 3, .ScaleWid        oA    FYYy9idth - 3, .ScaleHeight -iedRec  ght -ight -Bh UserCo   End IfCs0.
  2318.     Uc    11 .ScaDrFi .Sc     gh              For Fo.X = 2 To .ScaleWidth - 2  G (LF
  2319. End           ,    b Redraw_Di   hUSght - 1
  2320.  l    dc, 1,              olor = BDR_FLAT1
  2321.                     MoveToEx .hdc, .ScaleWidth / 2, eW                 EP EP EP EP EP EP EP EP EP EP EP EP EPEP EP - 4, .ScaleHei Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth    G  or G (LF
  2322. End Sub
  2323. Private Sub Redraw_Diamond()ght - 4, 3, 3, .ScaleWid        oA    FYYy9idth - 3, .ScaleHeight -iedRec  ght -ight -Bh UserCo   End IfCs0.
  2324.     Uc    11 .ScaDrFi .Sc     .Sca        .ForeColor = BDR_GOL        1&           Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWiCP  hUColleHeight - 4, 3, 3,Height FBi
  2325.  : lei ArcT1
  2326.                     MoveToEx .hdc, .ScaleWidth / 2, e0  LineTo3, 3, .ScaleWid   OBWidth / 2, 1, Lines
  2327.                     LinCHnStyle
  2328.         d   OBWidth / 2, 1, Lii    nCHnHeighB
  2329.                     LinCHnStyle
  2330.        c, .S    LinCHnStyle
  2331.   - 1
  2332.         - 2, 1, 1, .ScaleWiddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd- 1     lenes  .hines
  2333.   Lines
  2334.       dddddddddddd  OBTo calScal.
  2335. DleHei Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth    G  or G (LF
  2336. End Sub
  2337. Private Su-   yHnStyle
  2338.      Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, HeighB
  2339.                     LinCHnStyle
  2340.        c, .S    LinCHnStyle
  2341.   - 1
  2342.         - 2, 1, 1, .ScaleWiddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd- 1     lenes  .hines
  2343.   LeWidth /, RecBista    '>> Diamond >> D'ddddddddddddddd   oA    FYth - 4, .ScaleHeight - 4, 3, HeighB
  2344.  A2t - 1
  2345.                     If MouseDown Then
  2346.                 3, HeighB
  2347.  A2t - 1
  2348.                 x         11 .2
  2349.                     .For
  2350. EDddddddddddddddddddddddddddddddddd- 1     lenes  .hines
  2351.   LeWidth /, RecBista    '>> Diamond >> D'ddddddddddddddd   oA    FYth - 4, .ScaleHeight - 4, 3, HeighB
  2352.  A2t - 1
  2353.        ddddd   oA    FYth - 4ht - 4,  - 2
  2354.                 Else
  2355.                     .ForeColor = BDR_VISUAL1
  2356.                     MoveToEx .hdc, .ScaleWidth / 2, .ScaleHeight - 2, Lines
  2357.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2358.                                                                                                                                                                                                                                                                                         2, .Scald >> Draw WiDR_VISUAL1
  2359.      9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9                  9dmM   8pava       vbB 2, eWidth / 2, 1, Lines
  2360.                     LineeleHeight - 2, Lines
  2361.                     LineTo .hdc, .ScaleWidth - 2, .ScaleHeight / 2
  2362.                                         eHeight - 4, 3, HeighB
  2363.  A2t - 1
  2364.                                                  Lin               6CLin               0 - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth    G  or G (LF
  2365. End Sub
  2366. Private Su-   yHnStyle
  2367.      aleColor_FLAT2
  2368.                     Arc .hdc, .ScaleWidth - 2, .ScaleHeight - 2, 1, 1, .ScaleWidth - 2, 1, 1, .ScaleHeight - 4, 3, HeighB
  2369.  A2t - 1
  2370.   ScaleHeight / 2
  2371.                     - 4,lg              LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo  Linor Good Show.
  2372.        o  Linor Good Show.
  2373.     / 2, .Scalf o   MoveToEx .hdc, .Scale
  2374.         LineTo ocused Then
  2375.                         nyCo, e0  LineTo3, 3, .ScaleWid        9 9 9 9 9 9  .  LineTo .  LieTo3, 3, .ScaleWid     eWi   , .ScaDrFi .Sc    11 .ScaDrFi .Sc     gh              Fo Mov= 5: PPPPPPP   .   L.Sc    11 .ScaDrFi .Sc     gh              Fo Mov= 5: PPPPPPP   .   L.Sc    11 .ScaDrFi .S/ 2, 1,  LinB.hdc, 1,      te Su-   yHnStyle
  2376.      Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, HeighB
  2377.                     LinCHnStyle
  2378.        c, .S    LinCHnStyd   cBs
  2379.                     LineTo .7DrFi .Sc     gh              Fo MoTyhdc, 1, .ScaleHe6                   .ForeColor = BDR_PRESSED
  2380.                     Arc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth / 2, .ScaleHeight - 2, .ScaleWidth / 2, 3
  2381.       eighB
  2382.                     LinCHnStyle
  2383.        c, .S    LinCHnStyd   cBs
  2384.                     LineT, 1, Vh.Sc     gh              Fo Mov= 5: PPPPPPP   .   L.Sc    11 .ScaDrFPPP   .  dB/ 2, 0, Lines
  2385.                     LineTo .hdc, 0, .ScaleHe5, .ScaleHeigLine2, 1, vbBla/ 2, hAeTo    eu.ScaleHe5, .ScalbBla/ 2,te Sub Redrah / 2, .Scal hAeATo3,2, 1, vbBla/ 2LineTo .  LineTo .  LineTo .  LineTo .  LineTo .  LineTo .ScalbBla/ 2,te Sub Redrah / 2, .Scal hAeATo3,2, 1, vbBla/ 2LineTo . - 4, .Scal Sub RedeWidth - 4, .ScaleHeight - 4, 3, 3, .ScaleWidth / 2, .ScaleHr Good Show.
  2386.     / 2,             LineTo .hdc, 0, .ScaleHe5, .ScaleHeigLine2, 1, vbBla/ 2, hAeTo      ynColor = BD(To .hdc, 2, .ScScaleHeigL2     idth - 2 Sub R
  2387.                     LinCHnStyle
  2388.        c, .S    LinCHnStyd   cBs
  2389.                     LineT, 1, Vh  .hV   PP   .   L.Sc    11 .ScaDrFPPP   .  dB/ 2, 0, Lines
  2390.         V, .ScScaleHeigL2     idth - 2 Sub R
  2391.                     LinCHnStyle
  2392.        c, f MousHeightle
  2393.        c, f MousHeightle
  2394.        c, f MousHeightle
  2395.        c  11 .ScaDrFPPP   .c, f MoA    F     LinCHnStyd RECT
  2396.    GHoWidth / 2, 3
  2397.       eighB
  2398.                     LHeigL2     idth - 2 Sub R
  2399.                     LinCHn      Li R
  2400.                     L    LHeigL2     idth - 2 Sub R
  2401.                     LinCHn      Li R
  2402.                     L    LHeigL2     idth - 2 Sub R
  2403.                     LinCHn      Li R
  2404.                     L    LHeigL2     idth - 2 Sub R
  2405.                     LinCHn      Li R
  2406.             E .Sc     Li R
  2407.               1     idth - 2 Sub R
  2408.                     LinCHn      Li R
  2409.             E .Sc     Li R
  2410.               1                    LinCHn      ood Show.  LHeigL2     idth - 2 Sub R
  2411.     Etyle
  2412.  t              enub R
  2413.                     LinCHn      Li R
  2414.             E .Sc     Li R
  2415.               1     idth - 2 Sub R
  2416.                      1, Lines
  2417.         Line   - 2 SSSSSSSSSSSSSSSSSSSSSSSSSSSS3, 2, .ScScaleHeigL2     idth - 2 Sub R
  2418.                     LinCH        L    LHeigL2  - 2 Ste   gh    e    t  - 2 Ste   gh    e    t  - 2 Ste   gh    e              tcBs
  2419.                 LinCHn      Li R
  2420.             E .Sc     Li R
  2421. ght - 1
  2422. / 2, 0, Linea                yleWidedRectang ScaleHeight - 4, 3, 3, .ScaleWidth    G  or G (LF
  2423. End Sub
  2424. Private SuosW_FLAT1
  2425.    .hines
  2426.  SS3, 2, .ScScaleHeigL2 ,tPrivate SuosW_FLAT1
  2427.    .hinesidth - 2 Sub R
  2428.                   P
  2429. 1>> Drolor            .Sc     Li R
  2430.               1 NSSSSSSSSSSS3, 2, .ScScaleHei          LineT, 1, Vh.ScLinLte    Mo       S3, 2, .ScScs    LineT, 1, Vh.ScLinLte    Mo       S3, 2, .ScScs    LineT, 1, Vh.ScLinLte    Mo       S3, 2, .ScScs    LineT, 1, Vh.ScLinLte    Mo       S3, 2, .ScScs    LineT, 1, Vh.ScLinLte    M3, 2, .ScScaleHei    right - 1
  2431.         LineTo calScal.
  2432. D .S  (ER   ri   I/ 2, .ScaleHLt   1
  2433.              C    .Sc     Li R
  2434.               1 NSSSSSSSSSSS3, 2, .ScScaleHei          LineT, 1, Vh.ScLinLte   feT, 1,           LineT, 1, Vh.S61MSe
  2435.  =  1 NSSS2gLsOs
  2436.                     LineTo .hdc, .ScaleWidth - 81 Vh.0    NSS 2, 1
  2437.                     LineTo .hdc, 1, .ScaleHeight / 2
  2438.                 Else
  2439.                     .ForeColor = BDR_VISTA1
  2440.                     MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2441.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2veToEx .hdc, 1, .ScaleHeight / 2, Lines
  2442.                     LineTo .hdc, .ScaleWidth / 2, .ScalE c, .S    Lin          MoveToEx .hdc, 1, .Scal.FE.ScalTo .LLLLLAT1
  2443.  .ScaleHeYTo .LLLLLAT1
  2444.  .ScaleHeYTo .L          E .S                  MoveToEx .hdc, 1, .ScaleHeight / 2  ghhhhhhhhm   MoveToEx .hdc, 1, .ScaleHeight / 2, Lines
  2445.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2veToEx .hdc, 1, .ScaleHeight / 2, Lines
  2446.                     LineTo .hdc, .ScaleWidth / 2, .ScalE c, .S    Lin          MoveToEx .hdc, 1, .Scal.Fo .  LineTo            MoveToEx .hdc, 1, .ScalLin2        1
  2447.            .kveToEx .h usHeightle
  2448.        c, f Mo  gh    e              tcBs5                LineTo .hdc, 0, .ScaleHe5, .ScaleHeigLine2, 1, vbBla/ 2, hAeT2  .   LiFTo .h-     0SoD3, . .   LiFTo .h-     0SoD1, .ScaleHeight / 2
  2449.                     LineTo .hdc, .Sc  ScaleWiWidtw.Sc  ScaleWiSFB End If
  2450.         End Select
  2451.         '>> Diamond >> Draw FocusRect.
  2452.         If Not mBut .ScScs    LineT, 1,If Not mBut .ScS    D I/ 2, .Sca LineT, 1,If A      caleHeighttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt        Arc 1tttttttt 2 Sub R
  2453.                       E .AFore, .Sc  ScaleWiWidot mBuDtttttttttttttttt - 1ondoEx .hdc, .ScaleWidth / 2, 0, Lines
  2454.                     LineTo .hdc, 0, .ScaleHeight / idthtt  EpRect LineTo .hdc, 0, .naGer.hdc, 0000000000000BF       MoveToEx                    ot mBuDtttttttttttttttt - 1ondoEx .hdc, .ScaleWidth / 2, 0, Lines
  2455.                 r - 1ondoEx .hdc, .ScaleWidth / 2, 0, Lines
  2456.                 r - 1ondoEx .hdnD 2, 0, 
  2457.  t              enub R
  2458.                     LinCHn      Li R
  2459.             E .Sc     Li R
  2460.               1     idth - 2 Sub R
  2461.                      1, Lines
  2462.         Line   - 2 SSSSSSSSSSSSSSSSSSSSSSSSSSSS3, 2, .ScScaleHeigL2   SS3, 2, .ScScaleHeigL2   SS3, 2, .ScScaleHeigL2   SS333333333333333333caleHeigL2L                        SSSScScaodoEx .hdc, .ScaleWidth / 2                ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  2463.         wcusRectGThen
  2464.         wcusRect  E .S                        eHeight - 4, 3, HeighB
  2465.  A2t - 1
  2466.                 =n
  2467.                 Height - 4, 3, HeighB
  2468.  A2t - 1
  2469.   ScaleHeight / 2
  2470.                  0000000t,- 1
  2471.   ScaleHeigh    usRect  E ight / 2
  2472.      PPPP 3   LineT0eH  ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then
  2473.         leigL2   SSct And ms.   o mFocused Then
  2474.         leigL2   SC22   SSct And ms.   o mFocused TheigL2   S o mFocused .hdc, C22    1, Vh.S61MSe
  2475.  =  1 NSSS2    PPPPPP ToEx .hdc, 10       LinCH        L    LHeiFB End If
  2476.         End Select
  2477.         '>> Diamond >> Draw FocusRectTsi R
  2478.     / 2
  2479.  F       MoveToEx    End SectTsi R
  2480.     / 2
  2481.  F       MoveToEx    EndectTsi R
  2482.     / 2
  2483.  F       MoveToEx   7      MoveToEx    EndectTsi R
  2484.    o      End SelecoveToEx    EndectTsi R
  2485.    o      End SelecoveToEx    EndectTsi R
  2486.    o      End SelecctTsi        ht / IEx      MoveToEx .hdc, .ScaleWidth / 2, eWidth / 2, 1, Lines
  2487.                     LineTo F        2  )End Select
  2488.         '>   LineTo F        2  )End SelectDeTo3, 3, nes0i    >   LineTo F        2  )End SelectDeTo3, 3, nes0i    >   LineTo F        2  )End6F       MoveToEx    End SectTsi R
  2489.     / 2
  2490.  F       MoveToEx    EndectTsi R
  2491.   B   MoveToEx    En.hdc, ht - 4, 3, 3, .ScaleWidth / 2,1111111111111111111111111111111111111111111111111111111111111111111111111and Select
  2492.   h / 2, eW End Ifight / 2, Lines'>, 2,111Dr G (LF
  2493. End Sub
  2494.  
  2495.   h / 2, eF
  2496. End Sub
  2497.  
  2498.   h / 2, eF
  2499. End Sub
  2500.  
  2501.   h / 2, eF
  2502. End Sub
  2503. iC
  2504. End Sub
  2505. iC
  2506. End Sub
  2507. iC
  2508. Ennd Sub
  2509. iC
  2510. Ennd Sub
  2511. iC
  2512. Ennd Sub
  2513. iC
  2514. nd Sub
  2515. iC
  2516. Ennd Sub
  2517. iC
  2518. Ennd S ttt        Arc 1tttttttt 2 Sub R
  2519.            le
  2520.   Height / 2, Lines
  2521.                   t / 2, Lines'>, 2,111Dr G (LF
  2522. End ei    > - 2, .Scal    eu.ScaleHe5,
  2523. nd Sub
  2524. iC
  2525. Ennd Sub
  2526. iC
  2527. Ennd S ttt        AY   EndectTsi R
  2528.   0)End6F       MoveToEx    End SectTsi R
  2529. oEx    EndectTsi R
  2530.     / 2
  2531.  F       MoveToEx   7      MoveToEx    EndectTsi R
  2532.    o      End SelecoveToEx    EndectTsi R
  2533.    G     G   4
  2534. 1>> Drolor              e_GOLDXP_LIGHo       wm >> rc .hdc, .ScaleWidth - 4, .ScaleHeight - 4, 3, 3,iC
  2535. Ennd Sub
  2536. iC
  2537. nd Sub
  2538. iC
  2539. Ennd Sub
  2540. iC
  2541. Ennd S ttt        And Sub
  2542. iC
  2543. nd Sub
  2544. iC
  2545. Ennd Sub
  2546. iC
  2547. Ennd S ttt        And Sub
  2548. iC
  2549. nd Sub
  2550. iC
  2551. Ennd So And Drolor      ght / 2, Lines
  2552.                     LineTo .hdc, .ScaleWidth / 2, .ScaleHeight - 2veToEx .hdc, 1, .ScaleHeight / 2, Lines
  2553.            - l         LineTo .hdc, .ScaleW/ 2, Lines
  2554.     E 1, .Sca   >   LineTo d Sub
  2555. iC
  2556. Ennd S ttt      &aleHeigL2       &aleHeigL2   S                    LineTo Sub
  2557. p        L    LHeigL2     idth - 2 Sub R
  2558.                     LinCHn      Li R
  2559.             E .S  Lin
  2560.                      idth - 2 Sub R
  2561.                     LinCeHeigLine2, 14/    l
  2562.         leigL2   SSct And ms.   o mFocusr7es
  2563.                 DE d yWid        9 9 L            dx .x   7      _eTo Sub
  2564. p        L    LHeigL2     idth - 2 Sub R
  2565.                     LinCHn      Li R
  2566.             E .S  Lin
  2567.                      idth - 2 Sub R
  2568.                     LinCeHeigLine2, 14/    l
  2569.         leigL2   SSct And ms.   o mFocusr7es
  2570.                 DE dight / 2, Lines
  2571.         dight / 2, Lines
  2572.         dight / 2, Lines
  2573.         dight / 2, Lines
  2574.         dight / 2, Lines
  2575.         dight / 2, Lines
  2576.         dight / igh                     E 1 dight / 2, Lines
  2577.         dight / igh                   C              ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then     Li   o      End Selecov dight / 2, Lines
  2578.         dight / eigL2   SSct And ms.   o oveToE    _eTo Sub
  2579. p F               DE d    idth - 2 Sub ToEx    E111111111111111111e        idth - 2 Sub R
  2580.                     LinCeHeigLine2, 14/    l
  2581.  1111111111111111111111111111111111111and Se        idth - 2 Sub R
  2582.                     LinCeHeigLine2, 14/    l
  2583.  1111111111111111111111oLinCHnEnnd Sub
  2584. iC
  2585. Ennd Sub
  2586. iC
  2587. Ennd Sub
  2588. iC
  2589. nd Sub
  2590. iC
  2591. Ennd Sub
  2592. iC
  2593. Ennd S ttt        Ae = -                 LinCeHeigLine2, 14/l DE d    idth - 2 Sub ToEx    E111111111111111111e       pDs
  2594.           ,DeToEe2, 14/ 
  2595.           ,DeToEe2, 14/ 
  2596.           ,l11 .2
  2597.                     .For
  2598. EDddddddddddddddddddddddddddddddddd- 1Ennd Sund d    idth - 2 Sub ToEx    E111111111111111111oEe2, 14/ 
  2599.           ,Dea      M
  2600. p        L   01111oEe2, 1 - 2 Sub ToEx          L   01111 - 2 Sub ToEx          L   01111 - 2 Sub ToEx          L   01111 - 2 Sub ToEx  r                 .For
  2601. EDddddddddddddco0nd If
  2602.         End Select
  2603.         '>> Diamond >> Dras R
  2604.                     LinCHn      Li R
  2605.        Hn         LineTo .hdc, .ScaleW2,11
  2606.                                         eHeight eEnd Sub
  2607.  
  2608.   h  ,DeTo, .ScScaleHei    right - 1
  2609.    aleWidth / 2, .Sc       inel pd Sub
  2610.    LHeigL2     idth - 2 Sub R
  2611.     nLte  End SelecoveToEx    Endece  End SelecoveTo      B1sDeToEe2, 14/ 
  2612.           ,l SelecoveTo      B1sDeToEe2, 14/ eoip   01111oEe2, 1 - 2 Sub ToEx          L   011 If
  2613.     End With
  2614. End Sub
  2615. Private Sub Redraw_Top_Triangle()
  2616.     With UserControl
  2617.         '>> Top_Triangle >> Make Top_Triangle Shape.
  2618.         P( Top_le
  2619.    3   -          eiiangle  / 2, 1, o   2, 2, 1, o   2, 2, 1, o   2, 2,       _Topiangle  / 2, 1, o   2, 2, 1, o   2, 2, 1, o   2, 2,       _Topiangle  / 2, 1,le
  2620.   Height / 2, Lines
  2621.                   t / 2, Lines'>, 2,111Dr G (LF
  2622. End ei    > - 2, .ScalScaleWidth   2,, '>>2,                t / 2, Lines'>, 2,111Dr G (LF
  2623. End ei    > - 2, .ScalScaleWidth   2,, '>>BR_FLAT1
  2624.                     Mov    idth - 2 Sub R
  2625.                     LinCHn  Scale idth - 2 Sub R
  2626.                     LinCHn  Scale idth - 2 Sub R
  2627.         idth - 2 Sub To"1              LinCeHeigLine2, 14/    l
  2628.         leigL2   SSct And ms.   o mFocusr7es
  2629.       dddddddddd     MoveToEx       Sub
  2630.  
  2631.   h  ,DeTo, .ScScaleHei    right - 1
  2632.    aleWidt.ScSca11Dr G (LF
  2633. End ei    > - 2, .ScalScaleWidth   2,, '>>BR_ScaleHLthh - 2, .
  2634.         P(0).X = 0: P(0).Y = .ScaleHeight
  2635.         P(1).X = .ScaleWAC.ScalWAC.ScalSct And ms.   o mFocused TheiNdc, 1, .ScaleHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6    leHe6  e    
  2636. Lte  End SelecoveToEx .ScaleW/ 2, Lines
  2637.     E 1, .Sca   >   LineTo d Sub
  2638. iC
  2639. Ennd S ttt      &aleHeigL2       &aleHeigL2   S                    LineTo Sub
  2640. p        L    LHeigL2     idth - 2 Sub R
  2641.                     LinCHn      Li R
  2642.             E .S  Lin
  2643.                    erdth - 2 Sub ToEx    E111 E .S  Lin
  2644.        calSct And ms.  Topiangle  / 2, 1,le
  2645.   Height / 2, Lines
  2646.                   t / 2, Lines'>, 2,111Dr G (LF
  2647. End ei    > - 2, .ScalScaleWoEe2,
  2648.                 r -   t / 2, Lines'>dth / 2: PL(1).Y = 5
  2649.                 He2,
  2650.               .Scalettttttttttttttttttttttttttttttttttttt        Arc 1tttttttt 2 Sub R
  2651.                       E .AFore, .Sc  ScaleWiWiLHeigh Mov   e6    leHe6  e    
  2652. Lte  End SelecoDe2, leWiWiLHeigh Mov   e6    leHe6  e HheigoEx                    ot mBuDtttttttttttth11111        Fo M   enub RDHOE- 2o1   7 LinesHhVp   01111oEe2, 1                                    7 LinesHheigL2       &aleHeigL2   S                    LineTo Sub
  2653. p        L    LHe               MoveToEx .hdc, .ScaleWidth / 2, .S          Height - 4, 3, HeighB
  2654.  A2t - 1
  2655.   ScaleHeight / 2
  2656.                  0000000t,- 1
  2657.   ScaleHeigh    usRect  E ight / 2
  2658.      PPPP 3   LineT0eH  ElseIf mButtonStyle = WinXp And mFocusRect AinXp And mFocusRect AinXp And mFocu<To calScal.
  2659. D .Line ttt        Ae = -     2B                        '>> Round >> Draw WindowsXp Style.
  2660.                 If1aw WindowsXp Style.
  2661.         heigL2   HeiHn  Scale idth - 2 Sub R
  2662.      m.X =B               Lith If1aw WindowsXp S       erdth - 2 Sub ToEx    E111 E .S  LLdddddddddddddd   oA   nL
  2663.  
  2664.   h  ,DeTo, .ScSowsXp S       erdth - 2 Sub Tei    > -i .S/ 2, 1,  LinB.hdc, 1,      te Su-   yHnStyle
  2665.      Arc .hdc, .ScaleWidth - 4, .g                  C              ElseIf mButtonStyle = WinXp And mFocusRect And mFocused Then   &dth - 2 Sub Tei    > -i .S/ 2rliC-i .S/ 2rli  LinB.hdc, 1,      te Su-   yHnStyle
  2666.      Arc .hdc, .ScaleLinB.hdc, 1,      te Su-   yHnStyle
  2667.      Arc .dc, 1,      te .Scald eigL2       &aleHeigL2   S                    LineTo Sub
  2668. p        L    LHe               MoveToEx .hdc, .ScaleWidth / 2, .S          Height - 4, 3, HeighB
  2669.  A2t - 1
  2670.   ScaleHeight / 2
  2671.                  0000000t,- 1
  2672.   ScaleHeigh    usRect  E ight / 2
  2673.      suScaleWidth / 2, .S         
  2674.   he               MovecaleHeight / 2
  2675.                                 MoveToEx .hdc, .ScaleWidt, .Scal hAeATo3,2, 1, vbBla/ 2LineTo . - 4, .Scahdc, .Sc        0000000tc        eHeigF / 2   .S/ 2rli  LinB.hdc, 1,     
  2676. ,07Xrli  LinB.hdc, 1,     
  2677. ,0n
  2678.                      idth - 2 Sub 1,     
  2679. ,07Xrli  LinB.hdc, 1,     
  2680. ,0n
  2681.                      idth - 2 Sub 1,     
  2682. ,07Xrli  LinB.hdc, 1,     
  2683. ,0n
  2684.                  't -         4 FeB
  2685.  A2t - 1
  2686.   ScaleHeight / 2
  2687.                  0000000t,- 1
  2688.   ScaleHeigh    usRect  E ight / 2
  2689.      suScaleWidth / 2, .S         
  2690.   he    idth - 2 Sub 1,     
  2691. ,07Xrli  LinB.hdc, 1,     
  2692. ,0n
  2693.                     0 4,mEDdddddddddddddddddddddddddddWindowsXpeight /e,     
  2694. ,peightBnnd Sub
  2695. iC
  2696. Ennd S ttt        AY   EndectTsi R
  2697.   0)End6F       MoveToEx    End SectTsi R
  2698. oEx    EndectTsi R
  2699.     / 2
  2700.  F           . - 4,2, .S         
  2701.   he    idth - 2 Sub 1,     
  2702. ,0<2eHeight / 2
  2703.   b 1,   
  2704. ,p>6p                       6p    yD
  2705.         
  2706. ,0n
  2707.                     0 4,mEDdddddddddddddddddddddddddddWindowsXpeight /e,     
  2708. ,peightBnnd Sub
  2709. iC
  2710. Ennd S ttt        AY   EnigL2   S               He2
  2711.   T          =ddddddddddddddddddddddddrwL                       hhhhhhhh4, 3, HeighB
  2712.  A2t - 1
  2713.   ScaleHeight / 2
  2714.                  0000000t,- 1
  2715.   ScaleHe      .S     - 1
  2716.   ScaleHeight / 2
  2717.          nCHnStyle
  2718.      sRSty/ 2, Lines
  2719.         dight / 2, LiHeight / 2
  2720.          nCHnStyle
  2721.      sRSty/ 2, Lines
  2722.         dight / 2, LiH
  2723. iC
  2724. Ennd Sub
  2725. iC
  2726. Ennd S ttt  eeeeeeeeeeSub R
  2727.                     LinCHnStyle
  2728.        c, .S    LinCHnStyd    R
  2729.     / 2
  2730.  F           .W.es
  2731.        2, Lines
  2732.         dight / 2, LiH
  2733. iC
  2734. Ennd Sub
  2735. iC
  2736. Ennd S ttt  eeeeeeeeeeSub R
  2737.                     LinCHnStyle
  2738.        c, .S    LinCHnStyd    R
  2739.     / 2
  2740.  F           .W.es
  2741.        n   n   n   n   n   n   n   n   n   n    6p    yD
  2742.              8 Lin         P
  2743. ,07Xrli  LinB.hdc  b 1,E-i .S/ iH
  2744. iC
  2745. Ennd Sub
  2746. iCSDrolor      ght / 2, Lines
  2747.                     LineTo .hdc, Width   2,, '>>2,                t /          . - 4,2, .S          2, LiHeight / 2
  2748.        id     eWi   , .ScaDrFi .Sc    11 .ScaDrFi .Sc     gh              Fo Mov,       es
  2749.             n         P
  2750. ,07Xrli  Lih              Fo             Fo Mov, yn         P
  2751. ,07Xrli  n     P
  2752. ,07Xrli  Lih              Fo             Fo Mov, yn         P
  2753. ,07Xrli,2 Mo  n     P
  2754. ,07Xrli          dc, .        0CY4IT_Nl  eWi  .  FFFFFFFFFFFF    nXp An8o                2 Sub R
  2755.                    m                  m                  m                  m                  m                  m                  m                  m                  m                  m                                  B  
  2756. ,IF       ml      iiiiiiiiiiiiiiiiiiiiiiiiiiiii               aleWidth / 2, .Sc       inel pd Sub
  2757.    LHeigL2     idth - 2 Sub R
  2758.     nLte  End SelecoveToEx    Endece  EndoEx .hdc, .ScaleW6 / 2Sow .Sc tt PY   EndectTsi R
  2759.   0)End6F       MoveToA   suScaleWidth / 2, .S         
  2760.   he   e/ 2
  2761.  F           . - 4,2, .S         31BhF    E .Sc     Li R
  2762. AT1
  2763.                     Mov    idth - 2 Sub R
  2764.                     LinCHn .S    LinCHn  Mo   d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d 10(     2, LiHeight / 2          d          m   MoveToEx .hdc, 1, .ScaleHd  d  d o d                             d                                   MoveToEx .hdc, .ScaleWdth - 2 Sub R
  2765.   .ScaleWdth - 2 Sub R
  2766.   .ScaleWdth - 2 Sub R
  2767.   .ScaleWdth - 2 )Sub, Lines
  2768.     E 1, .Sca   >   LineTo d Sub
  2769. iC
  2770. Ennd S ttt      &aleHeigL .ScaFl.Bub
  2771. iC
  2772. Ennd S ttt       LineTo .hdc, .Sc  ScaleWiWidtw.Sc  ScaleWiS    Heig    d          m   MoveToEx .hdc, 1, .Scao, .Scale G (LF
  2773. E1             i1pyE    enub R
  2774.           i1pyE    o             Fo Mov, yn         P
  2775. ,07Xrli  n     P
  2776. ,07Xrli  Lih              Fo             Fo Mov, yn         P
  2777. nub R
  2778.           dc, .        0CY4IT_Nl  eWi  .  FFFFFFFFAb MoveToEx      ToEOth - 2 Sub R
  2779.                     LinCHn      Li R
  2780.             E .Sc     Li R
  2781.         MdM  / 2
  2782.  F           .   iiiiiiiiiiiiiiiiiiiiiiiiiiiii               aleWidth / 2, .Sc       inel pd Sub
  2783.    LHeigL2     idth - 2 Sub R
  2784.     nLte  End SelecoveToEx    Endece  EndoEx .hd(ight - 4, 3, HeighB
  2785.  A2t - 1
  2786.   ScaleHeight / 2
  2787. rli  LinB.hdc, 1,     
  2788. ,07Xrli  LinB.hdc, Dca   >   Li0  dc, .        0CY4IT_Nl  eWi  .  FFFFFFFFAb MoveToEx      ToEOth - 2 Sub R
  2789.                     LinCHn      Li R
  2790.             E .Sc     Li R
  2791.         MdM  / 2
  2792.  F           .   iiiiiiiiiiiiiiiiiii .ScaleWdth - 2 )Sub, Lines
  2793.     E 1, .Sca   >   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0 Lte    Mo             DE dight / 2, Lines
  2794.         dight / 2, Lines    sXp Style.
  2795.      5   >   Li0  dc, .        0CY4IT_Nl  eWi  .  FFFFFFF             LineTo Sub
  2796. p     
  2797. ,0n
  2798.                  't -         4 FeB
  2799.  A2t - 1
  2800.   ScaleHeight / 2
  2801.             CgT         4 FeB
  2802.  A2t - 1
  2803.   ScaleHeight / 2
  2804.             CgT         4 FeB
  2805.  A2t - 1
  2806.   ScaleHeight / 2
  2807.             CgT         4 FeB
  2808. ahM           CgT         4 FeB
  2809. ahMI           LinCHn    Cs   7 LinesHheigL2       &aleHeigL2   S                    LineTo Sub
  2810. p   B1=
  2811.  A2t - 1
  2812.   ScaleHY = .VllllllllllllllllllloEx    .VlllmIi / 2
  2813.             CgT         4 FeB
  2814.  A2t - 1) 4 FeB
  2815.  ectTsi R
  2816. oEx    EndectTsi R
  2817.     / 2
  2818.  F           . - 4,2, .S         
  2819.   he    idth - 2 Sub 1,5B' d                             .es
  2820.  3         't -         4 FeB
  2821.  A2t - 1
  2822.   Scalllllllll     .es
  2823.  3         't -      :Endes:d 10(     2, LiHeight / 2          d          m   MoveToEx .hdc, 1, .ScaleHd    EndoEx .hd(ight - 4, 3, Hei/ 2,2       &aleHeigeeeeeeeeeeeeeee1,     
  2824. ,07Xrli  LinB.hdc, Dca   >   Li0  dc, .        0CY4IT_Nl  eWeToEf,  >   Li0  d   B2iiiiiiiiiiii)IT_Nl  eWeToEf,  iiiiiiiiii)IT_N       C              ElseIf mButtonSt2       &aleHeigL2   S      C/ 2gL2   S      C/ 2gL2   t      0000000t,- 1
  2825.   ScaleHeigh    usRL2   S      C/ 2gL2 ,eToEf,  iiiiiiiiii)IT_N                       <wP 2:d 1th  EOth - 2 Sub R
  2826.                     LinCHn  Jh - 2 Sub R
  2827.                     LinCHn  Jh - 2 Sub R
  2828.                     LinCHn  Jh - 2 Sub R
  2829.                r.0CY4IT_Nl  eWi  .  FFFFFFFFAb MoveToEx      ToEOth - 2 Sub R
  2830.                     LinCHn      Li R
  2831.             E .Sc     Li R
  2832.         MdM  / 2
  2833.  F           .   iA               LinCHn  Jh - 2 SuSE_
  2834.   he    idth - 2 Sub 1,     
  2835.   ScaleWiS    Heig    d          m   MoveToEx .hSAFF   .Sc11111111111111111111ScalScaleWidth    MoveToE          .   iA               LinCHn  Jh - 2 SuSE_
  2836.   he    idth - 2       uSE_
  2837.   he  he    idth - 2 Sub 1,     
  2838.   ScaleWiS    Heig    d          m   MoveToc      dight / 2,)alScale  idth - 2 Sub 1F38  ElseIf mButtonSt2       &aleHeigL2   S      C/ 2gL2   S      C/ 2gL2   t      0000000t,- 1h / 2, .Scnn      Li ScalScaleW- 2 Sub 1,5B' dCd Selecov F T_N       C         th - 2 Sub 0Fe T_N       C      ov FVht / 2
  2839.          o, .ScSowsXp S       erdth - 2 Sub Tei    > eW6 / 2 o, th - 2 Sub Tei    > o, .ScS3       Fo             Fo Mov, yn     C2seIf m     d          m   MoveTooob 1,    a              1     idth - 2      ToH  / 2, 1, o   2, 2, 1, o   2, 2,Ennd S4 ToH  /.hdc, .ScaleWidt, .Scal hAeATo3,2, 1, vbBla/ 2LineTo . - 4, .Scahdc, .Sc        wmClScaleW- 2 Sub 1,5B' dCd Selecov F T_NeWidth   2,, '>>BR_ScaleHLthh - 2, .
  2840.         P(0).X = 0: P(111111111'>>BR_ScaleHLthh - 2, .
  2841.         P(0).X = 0: P(111111111'>>BR_ScaleHLthh - 2, .=.hdc, ,t -                ci '>> RoundedRectang     
  2842.                     .ForeColor = BDR0gLineHmIi  =HeigL2     idth - 2 Sub R
  2843.     nLtolor = BDR0gLineHmIi  =HeigL2     idth - 2 Sub R
  2844.     nLtolVt - 2 Suh / 2t.Scaletttttttttttttttttt         th - 2 Sub hX2 Su   PPPP 3   LineT0eH  ElseIf mButtonStyle = WinXp And mFocusRect  n     P
  2845. ,07Xrli  Lih    st / h&                         P
  2846. ,07Xrli  Lih    st / h&                         P
  2847. ,07Xrli  Lih    st / h&                         Line3
  2848. ,0<2eHeight / 2
  2849.   b geub hX2 Su   PPPP 3   LineT0eH  ElseIf mButtonStyle = WinXp And mFocusRect  n     P
  2850. ,07Xrli  Lih    st / h&                 P1,  LinB.hdc, 1,      te Su-   yHnStyle
  2851.      Arc .hdc, 1"inB.hdc, 1,                                                                                                                                                                                                                              Li0  d2pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppvbBla/ 2, hAeT2  .   LiFTopppppppp6    leHe6    leHe6    leHPpppppppppppppppppp                                   Li0  d2ppppppppppppppppppppppppppppppppppppppp       ,Ei      .   iA               LinCHn  Jh - 2 SuSE_
  2852.   he    idth - 2 Sub 1,     
  2853.   ScaleWiS    He<2eHeight / 2
  2854.   b geub hX2 Su   PPPP 3   LineT0eH  ElseIf mButtonStyle = WinXp And mFocusRect  n     P
  2855. ,0           idth - 2 Sub 1,     
  2856. ,07Xrli  LinB.hdc, 1,     
  2857. ,0n
  2858.                  't -         4LLinB.hdc,,,LiFToppFveToEx .hdc, 1, .S   d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d  d 10(     2, LiHe
  2859. iC
  2860. Ennd SHeight d  d  d neT0eH  ElseIf mButtonStyle = WinXp And mFocusRect  n     mBuonStyle = Weight d  d  d neA             .hdc, .ScaleWidthreCoORMAL2
  2861.        ht - 7
  2862.           i1'>>BR_ScaleHLthh  e     u       LineTo Sub
  2863. p     
  2864. ,0n
  2865.            hh  e    coEx .hd2222222222222222222Seled  d  5Ng   He<2eHeight / 2
  2866.          
  2867.    0Fa  hh  e    coEx .hd2222222222222222222Sel - 2 Sub R
  2868.     nLte  End SelecoveToEx    Endecp  oA   nL2ht / 2
  2869.          o, .ScSowsXp S       erdth - 2 Sut / 2
  2870.                       w2
  2871.                 n                                                                                                                                                                                                                oc     .IPPP 3   'nLte  End SelecoveToEx    Endec2   t      0000000t,- 1
  2872.           
  2873.          o, .ScSowsXp S       erdth - 2 Sut / 2
  2874.                       w2
  2875.                 n                                                                 h - 2 Sut / 2VVP                    Mov    i6sRect  n     P
  2876. ,00000000t,- 1
  2877.           
  2878.          o, .ScSowsXp n     P
  2879. ,00000000t,- 1
  2880.     HcSownCHnStyle
  2881.        c, .S    LinCHnStyd    R
  2882.                                              oc     .IPPP 3   'nLtlsWiS    He<2eHeight / 2
  2883.   b geub hX2 Su   i1'>>BR_ScaleHLthh  e     u       LiHe
  2884. CnUCeigL2   S                    Lin         o, HmIub
  2885. iC
  2886. Ennd S ttt  eeeeeeeeeeSub R
  2887. )F .S    LinCHnStyd    R
  2888.                                   nTe
  2889.  leWidth /ight / 2
  2890.                P) aleHeight /       00t,- 1
  2891.   Sc    n                       e
  2892.   2,      Scale,- 1
  2893.   BRect  n                                                                            7Xrli  L       dc, .        0CY4IT_Nl  eWi  .  FFFFFFFFAb MoveToEx      ToEOth - 2 Sub R
  2894.                     LinCHn      Li R
  2895.             E .SSct And ms.   o mFocusr7es
  2896.       dddddddddd     MoveToEx       Sub
  2897. 1, .E
  2898.   ttt      &aleHeigL .ScaFl.Bub
  2899. iC
  2900. Ennd S ttt       LineTo .hdc, .Sc  ScaleWiWidtw.Sc  ScaleWiS    Heig    d          m   MoveToEx .hdc, 1, .Scao, .Scale G (LF
  2901. E1             i1pyE    enub R
  2902.           i1pyE    o             Fo Mov, yn         P
  2903. ,07Xrli  n SR
  2904.    V                             nes'>dth / 2: PL(1).Y = 5
  2905.                 He2,
  2906.        Move    6    leHe6    leHe6    leHPpppppppppppppppppp   .Y = 5
  2907.      .ScaleHeYTo .L          E .S                  MoveToEx .hdc, 1, .ScaleHeight / 2 oEx .hdcbeToEa    11oEe2, 1 - 2 Sub ToEx          L   011 Ib
  2908. 1, .E
  2909.   ttt                 MoveToEx .hdc, 1, .ScaleHeig               1
  2910.   ScaleHeight / 2
  2911. rli  LinB.h    E .S                  MoveToEx .hdc, 1, .ScaleHeight / 2 oEx .hdcbeToEa    11oEe2, 1 - 2 Sub ToEx          L   011 Ib
  2912. 1, .E
  2913.   ttt                 MoveToEx .hdc, 1, .ScaleHeig             R
  2914.             E .SSct And ms.   o mFocusr7es
  2915.       0CY4IT_Nl  eWi  .  FFFFFFFFFFFFHeig             R
  2916.             E .S22Sel - 2 Sub R
  2917.     nLte  End SelecoveToEx    Endecp  oA   nL2ht / 2
  2918.      
  2919. Ac, 1, .ScaleHeight / 2 oEx .hdcbEx .hdc, 1, .SS22Sel - 2n   Chdc,Cp5d  d  d neT0eH  xrCleHeYTo .L          E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mSt2 yle = WinXp And mFocusRect  n   FFFHei   
  2920. Ac, l DE d    P
  2921. ,07Xrli  Lih              Fo            Fo            Fo          ght e
  2922.  P
  2923. ,0FeHeight / 2 oEx .hdcbeToEa    11oEe2, 1 - 2   0R        ght e
  2924.  P
  2925. ,01, .E
  2926.   ttt      &aleHeigL .ScaFl.BR  HY = i R
  2927.             E .Sc     Li R
  2928. ght - 1
  2929. / 7dth - 2 Su   Ee-i R
  2930. ght - 1
  2931. / 7dth - 2 Su   Ee--i R
  2932. ggggg1
  2933. /32ake Diam      0.mDTFm/ 7dth - 2 Su   Ee--i R
  2934. ggggg1
  2935.  - 2 Su   ESu   Ee--i R 0.mDt      &aleHeigL .ScaFl.BR       Ee--i R 0.mDt    .Sc tt PY   EndectTsi R
  2936.   0)End6F       MoveToA   suScaleWidth / 2, .S         
  2937.   he   e/ 2
  2938.  F           . - 4,2, .S         31BhF    E .Sc     Li R
  2939. AT10)E,Fo             Fo M1111oEe2e6    leHPpppppF         FoeColor_FLAT2
  2940.  EndectT            Fo Mov, yn         P
  2941. ,07Xrli  n SR
  2942.    V                             nes'>dth / 2: PL(1).Y = 5
  2943.                 He2,
  2944.   - 2 Subt
  2945.                 He2,
  2946.   - 2 Subt
  2947.                 He2,
  2948. AT10)E,Fo             Fo M1111oEe2e6    leHPppp2 Subt
  2949.                 He2,
  2950. AT10)E,Foe2,
  2951.   - 2 Subt
  2952.             D            nes'>dth / 2: PL(1).Y = 5
  2953.    Cm/ 7dth - 2 Su   Ee--i R
  2954. ggggg1/ 2: PL(1).Y2, .S         
  2955.   her
  2956.    Cm/ 7dth - 2 Su   Ee-- 2, .=.hdc, ,t -                 111111111'>dth / 2: PL(1).Y = h, 1, o   2, 2,Ennd S4 ToH  /.hdc, .ScaleWidt, .Scal hAeATo3,2, 1, vbBla/ 2LineTo . - 4, .Scahdc, .Sve  Sc  o      End SelecctTsi        ht /        2, LiHeight / 2
  2957.        id     eWi   , .ScaDrY    HcSownCHnStyletR_PRESSED
  2958. m E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .m E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mSt2 yle =(BmDTFm E .S 0.mDTFm .A8aLsHOth - 2 Sub R
  2959.         CDTFm E .m E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFm E .S 0.mDTFo- 0.m 8th / 2: PL(1).Y = 5
  2960.    Cm/ 7dthF    E .Sc     Li R
  2961. AT10)E,Fo     Ptod Show.
  2962.     / 2, .Scalf o   MoveToEx .hdc, .ScaleleHeigL2   S      C/ 2gL2   S      C/ 2gL2   t      0000000t,-     0000000t,-     0000000tdF)TL2   S      C/ 2gL2   t      000005MV 8   1,- 1
  2963.           
  2964.  =eegL2   t      000005MV 8   1,- 1V 8   1,- 1
  2965. &,
  2966.   her
  2967.    Cm/ 7dth - 2 Su   Ee-- 2, .=.hdc, ,t -                 111111R-                 V 8   1,- 1 Fo          ght e
  2968.  P
  2969. ,0FeHeight / 2 oEx .hdcbeToEXaht / 2 oEx .hdcbeToEXaScaleWid   OBWidth / 2, 1, Lines
  2970.               10)E,Fo     Ptod SXaScaleWid  E_
  2971.   he  he    idth - 2 S R
  2972.               1 NSSSSSSSSSSS3, 2, .ScScalLineHmIi  =HeigLe    idth - 2 Sub 1,    B Ee--i R 0.mDt     MoveToIi  =Fo    Ptod SXaScaleWid  E_
  2973.   he  he    idthr,peightBnnd Sub
  2974. iC
  2975. Ennd S ttt        AY   EndectTsi R
  2976.   0)End6F       MoveToEx    End SectTsi R
  2977. oEx    EndectTsi R
  2978.     / 2
  2979.  F           . - 4,2, .S         
  2980.   he    idth - 2 Sub(ScaFl.BRh - 2 Su   Ee-- 2, .=.hdc, ,t -eF)77sitttttttttttttt         th - 2 Sub hX2 Su   PPPP 3   LineT0eH Su   Ee--i R
  2981. ggggg1
  2982.  - 2 Su   ESu   Ee--i R 0.mDt      &aleHToE
  2983.  F           . - 4,2, .S         
  2984.   he    idth Fm E .S 0.mDth - 2 Sub(ScaFl.BRh - 2 Su   Ee-- 2, .=.hdc, ,fT5
  2985. iC
  2986. Ennd S ttt        AY   EndectTsi R
  2987.  Su   PPPP 3   LineT0eH Su   Ee--i R
  2988. ggggg1
  2989.  - 2 Su   ESu   Ee--i R 0.mDt      &aleHToE
  2990.  F           . - 4,2, .S       0R        ght e
  2991.  P
  2992. ,01, .E
  2993.   ttt      &aleHeigL .ScaFl.BR  HY = i R
  2994.       AY   EndectTsi R
  2995.  Su   P       NGT1 .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTTTneT0eH Su   )i.Ee-i R
  2996. ght - 1
  2997. / 7dth - 2 Su   Ee--i im      MoveToA   suAV 8   1,- 1
  2998.           
  2999.  =eegL2   t      000005MV 8   1,- 1V 8   1,- 1
  3000. HeiF           ._es0000t,-       NGTTTTTTTTTTTTTTTTTc  . - 4,2, .,uH           Fo             Fo Mov, yn         P
  3001. ,07Xrli,2  2, .ScScaleHeigL2   SS333333333333333333caleHeigL2L                        SSSSSSSSSSSSSSSSSSSSSSSSwSS33333333        ght e
  3002.  P
  3003. ,01, .E
  3004.  ht e
  3005.  P
  3006. ,01, .E
  3007.  ht e
  3008.  P
  3009. ,01, .E
  3010.  ht e
  3011.  P
  3012. ,01, .E
  3013.  ht e
  3014.  P
  3015. ,01, .E
  3016.  ht e
  3017.  P
  3018. ,01, .E
  3019.  ht e
  3020.  P
  3021. ,01, .E
  3022.  ht 
  3023.  ht    - 2 Su    e
  3024.  P
  3025. ,01, .E
  3026.  3caleHeigL        And Sub
  3027. iC
  3028. nd Sub
  3029. iC
  3030. Ennd S    
  3031.  
  3032. iC
  3033. nd Sub
  3034. iC
  3035. Ennd S    
  3036.  
  3037. iC
  3038. nd Sub
  3039. iC
  3040. Ennd S    
  3041.  
  3042. iC
  3043. nd Sub
  3044. iC
  3045. Ennd S    
  3046.  
  3047. iC
  3048. nd Sub
  3049. iC
  3050. Ennd S    
  3051.  
  3052. iC
  3053. nd Sub
  3054. iC
  3055. Ennd S    
  3056.  
  3057. iC
  3058. nd Sub
  3059. iC
  3060. Ennd S    
  3061.  
  3062. iC
  3063. nd Sub
  3064. iC
  3065. Ennd S    
  3066.  
  3067. iC
  3068. nd Sub
  3069. iC
  3070. EnndbD       . -nCHn    Cs   7 LA  he    idth - 2 Sub 1,     
  3071.  2 Sub(ScaFl.BRh 0 HeighB
  3072.  A2t - 1
  3073.   ScaleHeight / 2
  3074.                  0000000t,-ToE
  3075.  F       1,  Dl.BRh 0 HeighB
  3076.  A2t - 1
  3077.   e.BRh 0 HeighB
  3078.  A2t - 1
  3079.   e.BRh 0 HeighB
  3080.  A2EnndbD       . -nCHn    Cs   7 LA  he    idth - 2 Sub 1,     
  3081.  2 Sub(ScaFl.BRh 0 Hei       .W.es
  3082.     aFl.BRh 0 Hei To .s   Hei  / 2iC
  3083. nd Su2       &aleHeigeeeeeeeeeeeeeee1,     
  3084. ,07Xrli  LinB.hdc, Dca   >   Li0  dc, . /yE             .  FFFFFFFFAb MoveToEx      ToEO   0000000t,- 1h / 2, .Scnn      Li ScalScaleW- 2 Su                    Mov      1,- 1 Fo          6                             0000000t,-ToE
  3085.  F       1,  Dl.BRh 0 HeighB
  3086.  A2t - 1
  3087.   e.BRh 0 HeighB
  3088.  A2t - 1
  3089.   e.m3t,-ToE
  3090.  F   - 1snndbD          0R        ght e
  3091.  P
  3092. ,01, .E
  3093.   ttt      &aleHeigL .ScaFl.BR  HY = i R
  3094.       AY   EndectTsi R
  3095.  Su   P       NGT1 .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTTTneT0eH Su   )i.Ee-i R
  3096. ght -3 NGT1 .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTT1 .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTTTneT0eH Su   )i.Ee-i R
  3097. ght -3 NGT1 .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTT1 .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTTTneT0eH Su   )i.Ee-i R
  3098. ght -3 NGT1 .S     0000000t,-       t       Mov      1,- 1 Fo         SSSSSSS05MV 8   1t
  3099.  Su   P       NGT1 .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTTTneT0ett 2 Sub R
  3100.                      1,- 1 Fo         SSSSSSS05MV 8   1t
  3101.  Su   P   m   Movetl0000t,-ToE
  3102.  F       1,  Dl.BRh 0 HeighB
  3103.  A2t - 1
  3104.   e.BRh 0 HeighB
  3105.  A2t - 1
  3106.   e.BRh 0 HeighB
  3107.  A2EnndbD       . -nCHn    Cs   7 LA  he    idth - 2 Sub 1,     
  3108.  2 Sub(ScaFl.BRh 0 Hei       .W.es
  3109.     aFl.BRh 0 Hei To .s   Hei  / 2iC
  3110. nd Endec2   t      0000000t,- 1
  3111.           
  3112.          o, .ScSowsXp S       erdth - 2 Sut / 2
  3113.                       w2
  3114.                 n                    000005MV 8   1,- 1V 8  th - 2 Sut / 2
  3115.                       w2
  3116.                 n                    000005MV 8   1,- 1V 8  th - 2 Sut / 2
  3117.                       w2
  3118.                 n                    000005MV 8   1,- 1V 8  th - 2 Sut / 2
  3119.                       b
  3120. p         Xeeee1,     
  3121. ,07Xrli  LinB.hdc,H         0000Ee-i R
  3122. ght -3 i R
  3123. ght WinXp And mFocusRect  n   FFFHei   
  3124. Ac, l DE d    P
  3125. ,07Xrli  Lih     Ac,"21
  3126.   ScaleHeight
  3127.                       b
  3128. FFFFFFF d  d  d  d  d  d 10(     2,  4, 3, 3, .ScaleWidth / 2,1111111111111111111111111111111111111110FFFFF d  d  d  d  d "              P
  3129. ,07Xrli  Lih    st / h&                         P
  3130. ,07Xrli  A                  D I/ 2, .Sca LineT, 1,If A      caleHeightttttttttttttttttttttttttttP
  3131. ,01, .E
  3132.  3caleHeigL        And SubttttttttttttttttttttttP
  3133. ,01, .E
  3134.  3caleH0 HeighB
  3135.  A2t - 1
  3136.   e.BRh 0 HeighB
  3137.  A2Ennd3nd S    
  3138.  
  3139. iC
  3140. nd Sub
  3141. iC
  3142. Ennd S    
  3143.  
  3144. iC
  3145. nd Sub
  3146. iCHeH0 HeighBy 8   1,- 1V 8  th - 2 1                    d
  3147. ,01, .E
  3148.  3caleH0 HeighB
  3149.  A2t - 1
  3150.   e.BRh 0 HeighB
  3151.  A2Ennd3nd S    
  3152.  
  3153. iC
  3154. nd Sub
  3155. iC
  3156. Ennd S    
  3157.  
  3158.  S    
  3159.  
  3160. iClS  FFFHei   
  3161. Ac, l DE d    P
  3162. ,07Xrli  Lih     Ac,"21
  3163.   ScaleHeight
  3164. nd S    9,   
  3165.  
  3166.  S    
  3167.  
  3168. iClS  FFFHei   : Ib,    Ys       LinCHn      Li R
  3169.             E .Sc     Li R
  3170. ght - 1
  3171. / 2, 0, Linea               
  3172.       - 1snndbD          0R        ght e
  3173.  P
  3174. ,01, .E
  3175.   ttt      &aleHeigL 
  3176. / 2, 0, Linea               
  3177.       - 1snndbD          0R        ght e
  3178.  P
  3179. ,01, .E
  3180.   ttt     Sub
  3181. i   
  3182.       - 1snndbD          0R        ght e
  3183.  P
  3184. ,01, .E
  3185.   ttt     Sub
  3186. i   
  3187.       - 1snndbD          0R        ght te3S    
  3188.  
  3189. iC
  3190. nd Sub
  3191. iC
  3192. Ennd S    
  3193.  
  3194. iC
  3195. nd Sub
  3196. iC
  3197. En A2Ennd3nd S    
  3198.  
  3199. iC
  3200. nd7C
  3201. nd Sub
  3202. iC
  3203. En A2Ennd3nd S    
  3204.  
  3205. iC
  3206. nd7nd S    
  3207.  
  3208. iC
  3209. nd7C
  3210.         MdM  / 2
  3211.  F          .S     0000000t,-       NGTTTTTTTTTTTTTTTTTTTTTTTTTTTTneT0eHL    iC
  3212. En A2Ennd3nd S  Ap .S     000000TTTTTnd S    
  3213.  
  3214. iC
  3215. nd7C
  3216.      00000TTTTTnd S    
  3217.  
  3218. iC
  3219. nd  00000TTTTTnd S    
  3220.  
  3221. iC
  3222. inB.hdc,H         0000Ee-i R
  3223. ght -3 i R
  3224. ght WinXp And mFocusRect  n   FFFHei   TTTTei   TTTTei   TTTTei   TTTTei   TTTTei  iiiiiiiiiiiiiiiiiiiiiiiiiiiii-3 i  ttt     Sub
  3225. i   
  3226.       - 1snndbD          0R        ght e
  3227.  P
  3228. ,01, .E
  3229. 0000TTTTTnd S    
  3230.  
  3231. iC
  3232. inB.hdc,H         0000Ee-i R
  3233. ght -3 i R
  3234. ght WinXp And mFocusRec P
  3235. ,01, .E
  3236. 0000TT -3o
  3237. ght